Method and apparatus for beat acquisition during template generation in a medical device having dual sensing vectors

ABSTRACT

A method and medical device for generating a template that includes sensing a cardiac signal from a plurality of electrodes, determining a plurality of beats in response to the sensed cardiac signal, determining whether to store a beat of the plurality of beats in a subgroup of a plurality of subgroups for storing beats, determining whether a number of beats stored in one of the plurality of subgroups exceeds a subgroup threshold, and generating a template in response to beats stored in the one of the plurality of subgroups that exceeds the subgroup threshold.

RELATED APPLICATION

Cross-reference is hereby made to commonly assigned U.S. patentapplication Ser. No. 14/604,111, filed on even date herewith entitled“METHOD AND APPARATUS FOR BEAT ACQUISITION DURING TEMPLATE GENERATION INA MEDICAL DEVICE HAVING DUAL SENSING VECTORS”, and incorporated byreference in its entirety.

TECHNICAL FIELD

The disclosure relates generally to implantable medical devices and, inparticular, to an apparatus and method for acquiring beats utilized forcardiac event template generation in a medical device.

BACKGROUND

Implantable medical devices are available for treating cardiactachyarrhythmias by delivering anti-tachycardia pacing therapies andelectrical shock therapies for cardioverting or defibrillating theheart. Such a device, commonly known as an implantable cardioverterdefibrillator or “ICD”, senses electrical activity from the heart,determines a patient's heart rate, and classifies the rate according toa number of heart rate zones in order to detect episodes of ventriculartachycardia or fibrillation. Typically a number of rate zones aredefined according to programmable detection interval ranges fordetecting slow ventricular tachycardia, fast ventricular tachycardia andventricular fibrillation. Intervals between sensed R-waves,corresponding to the depolarization of the ventricles, are measured.Sensed R-R intervals falling into defined detection interval ranges arecounted to provide a count of ventricular tachycardia (VT) orventricular fibrillation (VF) intervals, for example. A programmablenumber of intervals to detect (NID) defines the number of tachycardiaintervals occurring consecutively or out of a given number of precedingevent intervals that are required to detect VT or VF.

Tachyarrhythmia detection may begin with detecting a fast ventricularrate, referred to as rate- or interval-based detection. Once VT or VF isdetected based on rate, the morphology of the sensed depolarizationsignals, e.g. wave shape, amplitude or other features, may be used indiscriminating heart rhythms to improve the sensitivity and specificityof tachyarrhythmia detection methods.

A primary goal of a tachycardia detection algorithm is to rapidlyrespond to a potentially malignant rhythm with a therapy that willterminate the arrhythmia with high certainty. Another goal, however, isto avoid excessive use of ICD battery charge, which shortens the life ofthe ICD, e.g. due to delivering unnecessary therapies or therapies at ahigher voltage than needed to terminate a detected tachyarrhythmia.Minimizing the patient's exposure to painful shock therapies is also animportant consideration. Accordingly, a need remains for ICDs thatperform tachycardia discrimination with high specificity and controltherapy delivery to successfully terminate a detected VT requiringtherapy while conserving battery charge and limiting patient exposure todelivered shock therapy by withholding therapy delivery wheneverpossible in situations where the therapy may not be required.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a conceptual diagram of a patient implanted with an exampleextravascular cardiac defibrillation system.

FIG. 2 is an exemplary schematic diagram of electronic circuitry withina hermetically sealed housing of a subcutaneous device according to anembodiment of the present invention.

FIG. 3 is a state diagram of detection of arrhythmias in a medicaldevice according to an embodiment of the present invention.

FIG. 4 is a flowchart of a method for detecting arrhythmias in asubcutaneous device according to an embodiment of the presentdisclosure.

FIG. 5 is a flowchart of a method for performing beat-based analysisduring detection of arrhythmias in a medical device, according to anembodiment of the present disclosure.

FIG. 6 is a flowchart of a method for aligning an ECG signal of anunknown beat with a known morphology template for beat-based analysisduring detection of arrhythmias in a medical device, according to anembodiment of the present disclosure.

FIG. 7 is a flowchart of a method for computing a morphology metric todetermine the similarity between a known template aligned with anunknown cardiac cycle signal according to one embodiment.

FIG. 8 is an exemplary plot of alignment of an unknown beat and atemplate for computing a normalized waveform area difference duringbeat-based analysis, according to one embodiment.

FIG. 9 is an exemplary plot illustrating a technique for determining anR-wave width and computing a normalized waveform area difference duringbeat-based analysis, according to another embodiment.

FIG. 10 is a flowchart of a method for determining an individual beatconfidence during beat-based analysis, according to one embodiment.

FIG. 11 is an exemplary plot illustrating determining pulses for a beatwithin a window during a beat-based analysis according to an embodimentof the disclosure.

FIG. 12 is a flowchart of a method for acquiring beats for generating atemplate according to an embodiment of the disclosure.

FIG. 12A is a schematic diagram of detection of simultaneously sensedR-waves sensed along two sensing vectors according to an embodiment ofthe disclosure.

FIG. 13 is a flowchart of generating a template according to anembodiment of the disclosure.

FIG. 14 is a schematic diagram of determining of subgroups for qualifiedbeats during generation of a template, according to an embodiment of thedisclosure.

DETAILED DESCRIPTION

FIG. 1 is a conceptual diagram of a patient 12 implanted with an exampleextravascular cardiac defibrillation system 10. In the exampleillustrated in FIG. 1, extravascular cardiac defibrillation system 10 isan implanted subcutaneous ICD system. However, the techniques of thisdisclosure may also be utilized with other extravascular implantedcardiac defibrillation systems, such as a cardiac defibrillation systemhaving a lead implanted at least partially in a substernal orsubmuscular location. Additionally, the techniques of this disclosuremay also be utilized with other implantable systems, such as implantablepacing systems, implantable neurostimulation systems, drug deliverysystems, automatic external defibrillators (AED) or other systems inwhich leads, catheters or other components are implanted atextravascular locations within patient 12. This disclosure, however, isdescribed in the context of an implantable extravascular cardiacdefibrillation system for purposes of illustration.

Extravascular cardiac defibrillation system 10 includes an implantablecardioverter defibrillator (ICD) 14 connected to at least oneimplantable cardiac defibrillation lead 16. ICD 14 of FIG. 1 isimplanted subcutaneously on the left side of patient 12. Defibrillationlead 16, which is connected to ICD 14, extends medially from ICD 14toward sternum 28 and xiphoid process 24 of patient 12. At a locationnear xiphoid process 24, defibrillation lead 16 bends or turns andextends subcutaneously superior, substantially parallel to sternum 28.In the example illustrated in FIG. 1, defibrillation lead 16 isimplanted such that lead 16 is offset laterally to the left side of thebody of sternum 28 (i.e., towards the left side of patient 12).

Defibrillation lead 16 is placed along sternum 28 such that a therapyvector between defibrillation electrode 18 and a second electrode (suchas a housing or can 25 of ICD 14 or an electrode placed on a secondlead) is substantially across the ventricle of heart 26. The therapyvector may, in one example, be viewed as a line that extends from apoint on the defibrillation electrode 18 to a point on the housing orcan 25 of ICD 14. In another example, defibrillation lead 16 may beplaced along sternum 28 such that a therapy vector betweendefibrillation electrode 18 and the housing or can 25 of ICD 14 (orother electrode) is substantially across an atrium of heart 26. In thiscase, extravascular ICD system 10 may be used to provide atrialtherapies, such as therapies to treat atrial fibrillation.

The embodiment illustrated in FIG. 1 is an example configuration of anextravascular ICD system 10 and should not be considered limiting of thetechniques described herein. For example, although illustrated as beingoffset laterally from the midline of sternum 28 in the example of FIG.1, defibrillation lead 16 may be implanted such that lead 16 is offsetto the right of sternum 28 or more centrally located over sternum 28.Additionally, defibrillation lead 16 may be implanted such that it isnot substantially parallel to sternum 28, but instead offset fromsternum 28 at an angle (e.g., angled lateral from sternum 28 at eitherthe proximal or distal end). As another example, the distal end ofdefibrillation lead 16 may be positioned near the second or third rib ofpatient 12. However, the distal end of defibrillation lead 16 may bepositioned further superior or inferior depending on the location of ICD14, location of electrodes 18, 20, and 22, or other factors.

Although ICD 14 is illustrated as being implanted near a midaxillaryline of patient 12, ICD 14 may also be implanted at other subcutaneouslocations on patient 12, such as further posterior on the torso towardthe posterior axillary line, further anterior on the torso toward theanterior axillary line, in a pectoral region, or at other locations ofpatient 12. In instances in which ICD 14 is implanted pectorally, lead16 would follow a different path, e.g., across the upper chest area andinferior along sternum 28. When the ICD 14 is implanted in the pectoralregion, the extravascular ICD system may include a second lead includinga defibrillation electrode that extends along the left side of thepatient such that the defibrillation electrode of the second lead islocated along the left side of the patient to function as an anode orcathode of the therapy vector of such an ICD system.

ICD 14 includes a housing or can 25 that forms a hermetic seal thatprotects components within ICD 14. The housing 25 of ICD 14 may beformed of a conductive material, such as titanium or other biocompatibleconductive material or a combination of conductive and non-conductivematerials. In some instances, the housing 25 of ICD 14 functions as anelectrode (referred to as a housing electrode or can electrode) that isused in combination with one of electrodes 18, 20, or 22 to deliver atherapy to heart 26 or to sense electrical activity of heart 26. ICD 14may also include a connector assembly (sometimes referred to as aconnector block or header) that includes electrical feedthroughs throughwhich electrical connections are made between conductors withindefibrillation lead 16 and electronic components included within thehousing. Housing may enclose one or more components, includingprocessors, memories, transmitters, receivers, sensors, sensingcircuitry, therapy circuitry and other appropriate components (oftenreferred to herein as modules).

Defibrillation lead 16 includes a lead body having a proximal end thatincludes a connector configured to connect to ICD 14 and a distal endthat includes one or more electrodes 18, 20, and 22. The lead body ofdefibrillation lead 16 may be formed from a non-conductive material,including silicone, polyurethane, fluoropolymers, mixtures thereof, andother appropriate materials, and shaped to form one or more lumenswithin which the one or more conductors extend. However, the techniquesare not limited to such constructions. Although defibrillation lead 16is illustrated as including three electrodes 18, 20 and 22,defibrillation lead 16 may include more or fewer electrodes.

Defibrillation lead 16 includes one or more elongated electricalconductors (not illustrated) that extend within the lead body from theconnector on the proximal end of defibrillation lead 16 to electrodes18, 20 and 22. In other words, each of the one or more elongatedelectrical conductors contained within the lead body of defibrillationlead 16 may engage with respective ones of electrodes 18, 20 and 22.When the connector at the proximal end of defibrillation lead 16 isconnected to ICD 14, the respective conductors may electrically coupleto circuitry, such as a therapy module or a sensing module, of ICD 14via connections in connector assembly, including associatedfeedthroughs. The electrical conductors transmit therapy from a therapymodule within ICD 14 to one or more of electrodes 18, 20 and 22 andtransmit sensed electrical signals from one or more of electrodes 18, 20and 22 to the sensing module within ICD 14.

ICD 14 may sense electrical activity of heart 26 via one or more sensingvectors that include combinations of electrodes 20 and 22 and thehousing or can 25 of ICD 14. For example, ICD 14 may obtain electricalsignals sensed using a sensing vector between electrodes 20 and 22,obtain electrical signals sensed using a sensing vector betweenelectrode 20 and the conductive housing or can 25 of ICD 14, obtainelectrical signals sensed using a sensing vector between electrode 22and the conductive housing or can 25 of ICD 14, or a combinationthereof. In some instances, ICD 14 may sense cardiac electrical signalsusing a sensing vector that includes defibrillation electrode 18, suchas a sensing vector between defibrillation electrode 18 and one ofelectrodes 20 or 22, or a sensing vector between defibrillationelectrode 18 and the housing or can 25 of ICD 14.

ICD may analyze the sensed electrical signals to detect tachycardia,such as ventricular tachycardia or ventricular fibrillation, and inresponse to detecting tachycardia may generate and deliver an electricaltherapy to heart 26. For example, ICD 14 may deliver one or moredefibrillation shocks via a therapy vector that includes defibrillationelectrode 18 of defibrillation lead 16 and the housing or can 25.Defibrillation electrode 18 may, for example, be an elongated coilelectrode or other type of electrode. In some instances, ICD 14 maydeliver one or more pacing therapies prior to or after delivery of thedefibrillation shock, such as anti-tachycardia pacing (ATP) or postshock pacing. In these instances, ICD 14 may generate and deliver pacingpulses via therapy vectors that include one or both of electrodes 20 and22 and/or the housing or can 25. Electrodes 20 and 22 may comprise ringelectrodes, hemispherical electrodes, coil electrodes, helix electrodes,segmented electrodes, directional electrodes, or other types ofelectrodes, or combination thereof. Electrodes 20 and 22 may be the sametype of electrodes or different types of electrodes, although in theexample of FIG. 1 both electrodes 20 and 22 are illustrated as ringelectrodes.

Defibrillation lead 16 may also include an attachment feature 29 at ortoward the distal end of lead 16. The attachment feature 29 may be aloop, link, or other attachment feature. For example, attachment feature29 may be a loop formed by a suture. As another example, attachmentfeature 29 may be a loop, link, ring of metal, coated metal or apolymer. The attachment feature 29 may be formed into any of a number ofshapes with uniform or varying thickness and varying dimensions.Attachment feature 29 may be integral to the lead or may be added by theuser prior to implantation. Attachment feature 29 may be useful to aidin implantation of lead 16 and/or for securing lead 16 to a desiredimplant location. In some instances, defibrillation lead 16 may includea fixation mechanism in addition to or instead of the attachmentfeature. Although defibrillation lead 16 is illustrated with anattachment feature 29, in other examples lead 16 may not include anattachment feature 29.

Lead 16 may also include a connector at the proximal end of lead 16,such as a DF4 connector, bifurcated connector (e.g., DF-1/IS-1connector), or other type of connector. The connector at the proximalend of lead 16 may include a terminal pin that couples to a port withinthe connector assembly of ICD 14. In some instances, lead 16 may includean attachment feature at the proximal end of lead 16 that may be coupledto an implant tool to aid in implantation of lead 16. The attachmentfeature at the proximal end of the lead may separate from the connectorand may be either integral to the lead or added by the user prior toimplantation.

Defibrillation lead 16 may also include a suture sleeve or otherfixation mechanism (not shown) located proximal to electrode 22 that isconfigured to fixate lead 16 near the xiphoid process or lower sternumlocation. The fixation mechanism (e.g., suture sleeve or othermechanism) may be integral to the lead or may be added by the user priorto implantation.

The example illustrated in FIG. 1 is exemplary in nature and should notbe considered limiting of the techniques described in this disclosure.For instance, extravascular cardiac defibrillation system 10 may includemore than one lead. In one example, extravascular cardiac defibrillationsystem 10 may include a pacing lead in addition to defibrillation lead16.

In the example illustrated in FIG. 1, defibrillation lead 16 isimplanted subcutaneously, e.g., between the skin and the ribs orsternum. In other instances, defibrillation lead 16 (and/or the optionalpacing lead) may be implanted at other extravascular locations. In oneexample, defibrillation lead 16 may be implanted at least partially in asubsternal location. In such a configuration, at least a portion ofdefibrillation lead 16 may be placed under or below the sternum in themediastinum and, more particularly, in the anterior mediastinum. Theanterior mediastinum is bounded laterally by pleurae, posteriorly bypericardium, and anteriorly by sternum 28. Defibrillation lead 16 may beat least partially implanted in other extra-pericardial locations, i.e.,locations in the region around, but not in direct contact with, theouter surface of heart 26. These other extra-pericardial locations mayinclude in the mediastinum but offset from sternum 28, in the superiormediastinum, in the middle mediastinum, in the posterior mediastinum, inthe sub-xiphoid or inferior xiphoid area, near the apex of the heart, orother location not in direct contact with heart 26 and not subcutaneous.In still further instances, the lead may be implanted at a pericardialor epicardial location outside of the heart 26.

FIG. 2 is an exemplary schematic diagram of electronic circuitry withina hermetically sealed housing of a subcutaneous device according to anembodiment of the present invention. As illustrated in FIG. 2,subcutaneous device 14 includes a low voltage battery 153 coupled to apower supply (not shown) that supplies power to the circuitry of thesubcutaneous device 14 and the pacing output capacitors to supply pacingenergy in a manner well known in the art. The low voltage battery 153may be formed of one or two conventional LiCF_(x), LiMnO₂ or LiI₂ cells,for example. The subcutaneous device 14 also includes a high voltagebattery 112 that may be formed of one or two conventional LiSVO orLiMnO₂ cells. Although two both low voltage battery and a high voltagebattery are shown in FIG. 2, according to an embodiment of the presentinvention, the device 14 could utilize a single battery for both highand low voltage uses.

Further referring to FIG. 2, subcutaneous device 14 functions arecontrolled by means of software, firmware and hardware thatcooperatively monitor the ECG signal, determine when acardioversion-defibrillation shock or pacing is necessary, and deliverprescribed cardioversion-defibrillation and pacing therapies. Thesubcutaneous device 14 may incorporate circuitry set forth in commonlyassigned U.S. Pat. No. 5,163,427 “Apparatus for Delivering Single andMultiple Cardioversion and Defibrillation Pulses” to Keimel and U.S.Pat. No. 5,188,105 “Apparatus and Method for Treating a Tachyarrhythmia”to Keimel for selectively delivering single phase, simultaneous biphasicand sequential biphasic cardioversion-defibrillation shocks typicallyemploying ICD IPG housing electrodes 28 coupled to the COMMON output 123of high voltage output circuit 140 and cardioversion-defibrillationelectrode 24 disposed posterially and subcutaneously and coupled to theHVI output 113 of the high voltage output circuit 140.

The cardioversion-defibrillation shock energy and capacitor chargevoltages can be intermediate to those supplied by ICDs having at leastone cardioversion-defibrillation electrode in contact with the heart andmost AEDs having cardioversion-defibrillation electrodes in contact withthe skin. The typical maximum voltage necessary for ICDs using mostbiphasic waveforms is approximately 750 Volts with an associated maximumenergy of approximately 40 Joules. The typical maximum voltage necessaryfor AEDs is approximately 2000-5000 Volts with an associated maximumenergy of approximately 200-360 Joules depending upon the model andwaveform used. The subcutaneous device 14 of the present invention usesmaximum voltages in the range of about 300 to approximately 1000 Voltsand is associated with energies of approximately 25 to 150 joules ormore. The total high voltage capacitance could range from about 50 toabout 300 microfarads. Such cardioversion-defibrillation shocks are onlydelivered when a malignant tachyarrhythmia, e.g., ventricularfibrillation is detected through processing of the far field cardiac ECGemploying the detection algorithms as described herein below.

In FIG. 2, sense amp 190 in conjunction with pacer/device timing circuit178 processes the far field ECG sense signal that is developed across aparticular ECG sense vector defined by a selected pair of thesubcutaneous electrodes 18, 20, 22 and the can or housing 25 of thedevice 14, or, optionally, a virtual signal (i.e., a mathematicalcombination of two vectors) if selected. The selection of the sensingelectrode pair is made through the switch matrix/MUX 191 in a manner toprovide the most reliable sensing of the ECG signal of interest, whichwould be the R wave for patients who are believed to be at risk ofventricular fibrillation leading to sudden death. The far field ECGsignals are passed through the switch matrix/MUX 191 to the input of thesense amplifier 190 that, in conjunction with pacer/device timingcircuit 178, evaluates the sensed EGM. Bradycardia, or asystole, istypically determined by an escape interval timer within the pacer timingcircuit 178 and/or the control circuit 144. Pace Trigger signals areapplied to the pacing pulse generator 192 generating pacing stimulationwhen the interval between successive R-waves exceeds the escapeinterval. Bradycardia pacing is often temporarily provided to maintaincardiac output after delivery of a cardioversion-defibrillation shockthat may cause the heart to slowly beat as it recovers back to normalfunction. Sensing subcutaneous far field signals in the presence ofnoise may be aided by the use of appropriate denial and extensibleaccommodation periods as described in U.S. Pat. No. 6,236,882 “NoiseRejection for Monitoring ECGs” to Lee, et al and incorporated herein byreference in its' entirety.

Detection of a malignant tachyarrhythmia is determined in the Controlcircuit 144 as a function of the intervals between R-wave sense eventsignals that are output from the pacer/device timing 178 and senseamplifier circuit 190 to the timing and control circuit 144. It shouldbe noted that the present invention utilizes not only interval basedsignal analysis method but also supplemental sensors and morphologyprocessing method and apparatus as described herein below.

Supplemental sensors such as tissue color, tissue oxygenation,respiration, patient activity and the like may be used to contribute tothe decision to apply or withhold a defibrillation therapy as describedgenerally in U.S. Pat. No. 5,464,434 “Medical Interventional DeviceResponsive to Sudden Hemodynamic Change” to Alt and incorporated hereinby reference in its entirety. Sensor processing block 194 providessensor data to microprocessor 142 via data bus 146. Specifically,patient activity and/or posture may be determined by the apparatus andmethod as described in U.S. Pat. No. 5,593,431 “Medical ServiceEmploying Multiple DC Accelerometers for Patient Activity and PostureSensing and Method” to Sheldon and incorporated herein by reference inits entirety. Patient respiration may be determined by the apparatus andmethod as described in U.S. Pat. No. 4,567,892 “Implantable CardiacPacemaker” to Plicchi, et al and incorporated herein by reference in itsentirety. Patient tissue oxygenation or tissue color may be determinedby the sensor apparatus and method as described in U.S. Pat. No.5,176,137 to Erickson, et al and incorporated herein by reference in itsentirety. The oxygen sensor of the '137 patent may be located in thesubcutaneous device pocket or, alternatively, located on the lead 18 toenable the sensing of contacting or near-contacting tissue oxygenationor color.

Certain steps in the performance of the detection algorithm criteria arecooperatively performed in microcomputer 142, including microprocessor,RAM and ROM, associated circuitry, and stored detection criteria thatmay be programmed into RAM via a telemetry interface (not shown)conventional in the art. Data and commands are exchanged betweenmicrocomputer 142 and timing and control circuit 144, pacertiming/amplifier circuit 178, and high voltage output circuit 140 via abi-directional data/control bus 146. The pacer timing/amplifier circuit178 and the control circuit 144 are clocked at a slow clock rate. Themicrocomputer 142 is normally asleep, but is awakened and operated by afast clock by interrupts developed by each R-wave sense event, onreceipt of a downlink telemetry programming instruction or upon deliveryof cardiac pacing pulses to perform any necessary mathematicalcalculations, to perform tachycardia and fibrillation detectionprocedures, and to update the time intervals monitored and controlled bythe timers in pacer/device timing circuitry 178.

When a malignant tachycardia is detected, high voltage capacitors 156,158, 160, and 162 are charged to a pre-programmed voltage level by ahigh-voltage charging circuit 164. It is generally consideredinefficient to maintain a constant charge on the high voltage outputcapacitors 156, 158, 160, 162. Instead, charging is initiated whencontrol circuit 144 issues a high voltage charge command HVCHG deliveredon line 145 to high voltage charge circuit 164 and charging iscontrolled by means of bi-directional control/data bus 166 and afeedback signal VCAP from the HV output circuit 140. High voltage outputcapacitors 156, 158, 160 and 162 may be of film, aluminum electrolyticor wet tantalum construction.

The negative terminal of high voltage battery 112 is directly coupled tosystem ground. Switch circuit 114 is normally open so that the positiveterminal of high voltage battery 112 is disconnected from the positivepower input of the high voltage charge circuit 164. The high voltagecharge command HVCHG is also conducted via conductor 149 to the controlinput of switch circuit 114, and switch circuit 114 closes in responseto connect positive high voltage battery voltage EXT B+ to the positivepower input of high voltage charge circuit 164. Switch circuit 114 maybe, for example, a field effect transistor (FET) with itssource-to-drain path interrupting the EXT B+ conductor 118 and its gatereceiving the HVCHG signal on conductor 145. High voltage charge circuit164 is thereby rendered ready to begin charging the high voltage outputcapacitors 156, 158, 160, and 162 with charging current from highvoltage battery 112.

High voltage output capacitors 156, 158, 160, and 162 may be charged tovery high voltages, e.g., 300-1000V, to be discharged through the bodyand heart between the electrode pair of subcutaneouscardioversion-defibrillation electrodes 113 and 123. The details of thevoltage charging circuitry are also not deemed to be critical withregard to practicing the present invention; one high voltage chargingcircuit believed to be suitable for the purposes of the presentinvention is disclosed. High voltage capacitors 156, 158, 160 and 162may be charged, for example, by high voltage charge circuit 164 and ahigh frequency, high-voltage transformer 168 as described in detail incommonly assigned U.S. Pat. No. 4,548,209 “Energy Converter forImplantable Cardioverter” to Wielders, et al. Proper charging polaritiesare maintained by diodes 170, 172, 174 and 176 interconnecting theoutput windings of high-voltage transformer 168 and the capacitors 156,158, 160, and 162. As noted above, the state of capacitor charge ismonitored by circuitry within the high voltage output circuit 140 thatprovides a VCAP, feedback signal indicative of the voltage to the timingand control circuit 144. Timing and control circuit 144 terminates thehigh voltage charge command HVCHG when the VCAP signal matches theprogrammed capacitor output voltage, i.e., thecardioversion-defibrillation peak shock voltage.

Control circuit 144 then develops first and second control signalsNPULSE 1 and NPULSE 2, respectively, that are applied to the highvoltage output circuit 140 for triggering the delivery of cardiovertingor defibrillating shocks. In particular, the NPULSE 1 signal triggersdischarge of the first capacitor bank, comprising capacitors 156 and158. The NPULSE 2 signal triggers discharge of the first capacitor bankand a second capacitor bank, comprising capacitors 160 and 162. It ispossible to select between a plurality of output pulse regimes simply bymodifying the number and time order of assertion of the NPULSE 1 andNPULSE 2 signals. The NPULSE 1 signals and NPULSE 2 signals may beprovided sequentially, simultaneously or individually. In this way,control circuitry 144 serves to control operation of the high voltageoutput stage 140, which delivers high energycardioversion-defibrillation shocks between the pair of thecardioversion-defibrillation electrodes 18 and 25 coupled to the HV-1and COMMON output as shown in FIG. 2.

Thus, subcutaneous device 14 monitors the patient's cardiac status andinitiates the delivery of a cardioversion-defibrillation shock throughthe cardioversion-defibrillation electrodes 18 and 25 in response todetection of a tachyarrhythmia requiring cardioversion-defibrillation.The high HVCHG signal causes the high voltage battery 112 to beconnected through the switch circuit 114 with the high voltage chargecircuit 164 and the charging of output capacitors 156, 158, 160, and 162to commence. Charging continues until the programmed charge voltage isreflected by the VCAP signal, at which point control and timing circuit144 sets the HVCHG signal low terminating charging and opening switchcircuit 114. The subcutaneous device 14 can be programmed to attempt todeliver cardioversion shocks to the heart in the manners described abovein timed synchrony with a detected R-wave or can be programmed orfabricated to deliver defibrillation shocks to the heart in the mannersdescribed above without attempting to synchronize the delivery to adetected R-wave. Episode data related to the detection of thetachyarrhythmia and delivery of the cardioversion-defibrillation shockcan be stored in RAM for uplink telemetry transmission to an externalprogrammer as is well known in the art to facilitate in diagnosis of thepatient's cardiac state. A patient receiving the device 14 on aprophylactic basis would be instructed to report each such episode tothe attending physician for further evaluation of the patient'scondition and assessment for the need for implantation of a moresophisticated ICD.

Subcutaneous device 14 desirably includes telemetry circuit (not shownin FIG. 2), so that it is capable of being programmed by means ofexternal programmer 20 via a 2-way telemetry link (not shown). Uplinktelemetry allows device status and diagnostic/event data to be sent toexternal programmer 20 for review by the patient's physician. Downlinktelemetry allows the external programmer via physician control to allowthe programming of device function and the optimization of the detectionand therapy for a specific patient. Programmers and telemetry systemssuitable for use in the practice of the present invention have been wellknown for many years. Known programmers typically communicate with animplanted device via a bi-directional radio-frequency telemetry link, sothat the programmer can transmit control commands and operationalparameter values to be received by the implanted device, so that theimplanted device can communicate diagnostic and operational data to theprogrammer. Programmers believed to be suitable for the purposes ofpracticing the present invention include the Models 9790 and CareLink®programmers, commercially available from Medtronic, Inc., Minneapolis,Minn.

Various telemetry systems for providing the necessary communicationschannels between an external programming unit and an implanted devicehave been developed and are well known in the art. Telemetry systemsbelieved to be suitable for the purposes of practicing the presentinvention are disclosed, for example, in the following U.S. patents:U.S. Pat. No. 5,127,404 to Wyborny et al. entitled “Telemetry Format forImplanted Medical Device”; U.S. Pat. No. 4,374,382 to Markowitz entitled“Marker Channel Telemetry System for a Medical Device”; and U.S. Pat.No. 4,556,063 to Thompson et al. entitled “Telemetry System for aMedical Device”. The Wyborny et al. '404, Markowitz '382, and Thompsonet al. '063 patents are commonly assigned to the assignee of the presentinvention, and are each hereby incorporated by reference herein in theirrespective entireties.

According to an embodiment of the present invention, in order toautomatically select the preferred ECG vector set, it is necessary tohave an index of merit upon which to rate the quality of the signal.“Quality” is defined as the signal's ability to provide accurate heartrate estimation and accurate morphological waveform separation betweenthe patient's usual sinus rhythm and the patient's ventriculartachyarrhythmia.

Appropriate indices may include R-wave amplitude, R-wave peak amplitudeto waveform amplitude between R-waves (i.e., signal to noise ratio), lowslope content, relative high versus low frequency power, mean frequencyestimation, probability density function, or some combination of thesemetrics.

Automatic vector selection might be done at implantation or periodically(daily, weekly, monthly) or both. At implant, automatic vector selectionmay be initiated as part of an automatic device turn-on procedure thatperforms such activities as measure lead impedances and batteryvoltages. The device turn-on procedure may be initiated by theimplanting physician (e.g., by pressing a programmer button) or,alternatively, may be initiated automatically upon automatic detectionof device/lead implantation. The turn-on procedure may also use theautomatic vector selection criteria to determine if ECG vector qualityis adequate for the current patient and for the device and leadposition, prior to suturing the subcutaneous device 14 device in placeand closing the incision. Such an ECG quality indicator would allow theimplanting physician to maneuver the device to a new location ororientation to improve the quality of the ECG signals as required. Thepreferred ECG vector or vectors may also be selected at implant as partof the device turn-on procedure. The preferred vectors might be thosevectors with the indices that maximize rate estimation and detectionaccuracy. There may also be an a priori set of vectors that arepreferred by the physician, and as long as those vectors exceed someminimum threshold, or are only slightly worse than some other moredesirable vectors, the a priori preferred vectors are chosen. Certainvectors may be considered nearly identical such that they are not testedunless the a priori selected vector index falls below some predeterminedthreshold.

Depending upon metric power consumption and power requirements of thedevice, the ECG signal quality metric may be measured on the range ofvectors (or alternatively, a subset) as often as desired. Data may begathered, for example, on a minute, hourly, daily, weekly or monthlybasis. More frequent measurements (e.g., every minute) may be averagedover time and used to select vectors based upon susceptibility ofvectors to occasional noise, motion noise, or EMI, for example.

Alternatively, the subcutaneous device 14 may have an indicator/sensorof patient activity (piezo-resistive, accelerometer, impedance, or thelike) and delay automatic vector measurement during periods of moderateor high patient activity to periods of minimal to no activity. Onerepresentative scenario may include testing/evaluating ECG vectors oncedaily or weekly while the patient has been determined to be asleep(using an internal clock (e.g., 2:00 am) or, alternatively, infer sleepby determining the patient's position (via a 2- or 3-axis accelerometer)and a lack of activity).

If infrequent automatic, periodic measurements are made, it may also bedesirable to measure noise (e.g., muscle, motion, EMI, etc.) in thesignal and postpone the vector selection measurement when the noise hassubsided.

Subcutaneous device 14 may optionally have an indicator of the patient'sposture (via a 2- or 3-axis accelerometer). This sensor may be used toensure that the differences in ECG quality are not simply a result ofchanging posture/position. The sensor may be used to gather data in anumber of postures so that ECG quality may be averaged over thesepostures or, alternatively, selected for a preferred posture.

In the preferred embodiment, vector quality metric calculations wouldoccur a number of times over approximately 1 minute, once per day, foreach vector. These values would be averaged for each vector over thecourse of one week. Averaging may consist of a moving average orrecursive average depending on time weighting and memory considerations.In this example, the preferred vector(s) would be selected once perweek.

FIG. 3 is a state diagram of detection of arrhythmias in a medicaldevice according to an embodiment of the present invention. Asillustrated in FIG. 3, during normal operation, the device 14 is in anot concerned state 302, during which R-wave intervals are beingevaluated to identify periods of rapid rates and/or the presence ofasystole. Upon detection of short R-wave intervals simultaneously in twoseparate ECG sensing vectors, indicative of an event that, if confirmed,may require the delivery of therapy, the device 14 transitions from thenot concerned state 302 to a concerned state 304. In the concerned state304 the device 14 evaluates a predetermined window of ECG signals todetermine the likelihood that the signal is corrupted with noise and todiscriminate rhythms requiring shock therapy from those that do notrequire shock therapy, using a combination of R-wave intervals and ECGsignal morphology information.

If a rhythm requiring shock therapy continues to be detected while inthe concerned state 304, the device 14 transitions from the concernedstate 304 to an armed state 306. If a rhythm requiring shock therapy isno longer detected while the device is in the concerned state 304 andthe R-wave intervals are determined to no longer be short, the device 14returns to the not concerned state 302. However, if a rhythm requiringshock therapy is no longer detected while the device is in the concernedstate 304, but the R-wave intervals continue to be detected as beingshort, processing continues in the concerned state 304.

In the armed state 306, the device 14 charges the high voltage shockingcapacitors and continues to monitor R-wave intervals and ECG signalmorphology for spontaneous termination. If spontaneous termination ofthe rhythm requiring shock therapy occurs, the device 14 returns to thenot concerned state 302. If the rhythm requiring shock therapy is stilldetermined to be occurring once the charging of the capacitors iscompleted, the device 14 transitions from the armed state 306 to a shockstate 308. In the shock state 308, the device 14 delivers a shock andreturns to the armed state 306 to evaluate the success of the therapydelivered.

The transitioning between the not concerned state 302, the concernedstate 304, the armed state 306 and the shock state 308 may be performedas described in detail in U.S. Pat. No. 7,894,894 to Stadler et al.,incorporated herein by reference in it's entirety.

FIG. 4 is a flowchart of a method for detecting arrhythmias in asubcutaneous device according to an embodiment of the presentdisclosure. As illustrated in FIG. 4, device 14 continuously evaluatesthe two channels ECG1 and ECG2 associated with two predeterminedelectrode vectors to determine when sensed events occur. For example,the electrode vectors for the two channels ECG1 and ECG2 may include afirst vector (ECG1) selected between electrode 20 positioned on lead 16and the housing or can 25 of ICD 14, while the other electrode vector(ECG 2) is a vertical electrode vector between electrode 20 andelectrode 22 positioned along the lead 16. However, the two sensingchannels may in any combination of possible vectors, including thoseformed by the electrodes shown in FIG. 2, or other additional electrodes(not shown) that may be included along the lead or positioned along thehousing of ICD 14.

According to an embodiment of the present application, for example, thedevice 14 determines whether to transition from the not concerned state302 to the concerned state 304 by determining a heart rate estimate inresponse to the sensing of R-waves, as described in U.S. Pat. No.7,894,894 to Stadler et al., incorporated herein by reference in it'sentirety.

Upon transition from the not concerned state to the concerned state,Block 305, a most recent window of ECG data from both channels ECG1 andECG2 are utilized, such as three seconds, for example, so thatprocessing is triggered in the concerned state 304 by a three-secondtimeout, rather than by the sensing of an R-wave, which is utilized whenin the not concerned state 302. It is understood that while theprocessing is described as being triggered over a three second period,other times periods for the processing time utilized when in theconcerned state 304 may be chosen, but should preferably be within arange of 0.5 to 10 seconds. As a result, although sensing of individualR-waves continues to occur in both channels ECG1 and ECG2 when in theconcerned state 304, and the buffer of 12 R-R intervals continues to beupdated, the opportunities for changing from the concerned state 304 toanother state and the estimates of heart rate only occur once thethree-second timer expires. Upon initial entry to the concerned state304, it is advantageous to process the most recent three-seconds of ECGdata, i.e., ECG data for the three seconds leading up to the transitionto the concerned state 304. This requires a continuous circularbuffering of the most recent three seconds of ECG data even while in thenot concerned state 302.

While in the concerned state 304, the present invention determines howsinusoidal and how noisy the signals are in order to determine thelikelihood that a ventricular fibrillation (VF) or fast ventriculartachycardia (VT) event is taking place, since the more sinusoidal andlow noise the signal is, the more likely a VT/VF event is taking place.As illustrated in FIG. 4, once the device transitions from the notconcerned state 302 to the concerned state 304, Block 305, a buffer foreach of the two channels ECG 1 and ECG2 for storing classifications of3-second segments of data as “shockable” or “non-shockable” is cleared.Processing of signals of the two channels ECG1 and ECG2 while in theconcerned state 304 is then triggered by the three second time period,rather than by the sensing of an R-wave utilized during the notconcerned state 302.

Once the three second time interval has expired, YES in Block 341,morphology characteristics of the signal during the three second timeinterval for each channel are utilized to determine whether the signalsare likely corrupted by noise artifacts and to characterize themorphology of the signal as “shockable” or “not shockable”. For example,using the signals associated with the three second time interval, adetermination is made for each channel ECG1 and ECG 2 as to whether thechannel is likely corrupted by noise, Block 342, and a determination isthen made as to whether both channels ECG1 and ECG2 are corrupted bynoise, Block 344. According to one embodiment, for example, the devicemakes the noise determination in Block 344 as described in U.S. patentapplication Ser. No. 14/255,159 to Zhang, incorporated herein byreference in it's entirety.

Upon determining whether the channels ECG1 and ECG2 are corrupted bynoise is made, Block 342, a determination is made as to whether bothchannels are determined to be noise corrupted, Block 344. If the signalassociated with both channels ECG1 and ECG2 is determined to likely becorrupted by noise, both channels are classified as being not shockable,Block 347, and therefore a buffer for each channel ECG1 and ECG 2containing the last three classifications of the channel is updatedaccordingly and the process is repeated for the next three-secondwindows. If both channels ECG1 and ECG2 are not determined to be likelycorrupted by noise, No in Block 344, the device distinguishes betweeneither one of the channels being not corrupted by noise or both channelsbeing not corrupted by noise by determining whether noise was determinedto be likely in only one of the two channels ECG1 and ECG2, Block 346.

If noise was likely in only one of the two channels, a determination ismade whether the signal for the channel not corrupted by noise, i.e.,the clean channel, is more likely associated with a VT event or with aVF event by determining, for example, whether the signal for thatchannel includes R-R intervals that are regular and the channel can betherefore classified as being relatively stable, Block 348. If the R-Rintervals are determined not to be relatively stable, NO in Block 348,the signal for that channel is identified as likely being associatedwith VF, which is then verified by determining whether the signal is ina VF shock zone, Block 350, described below. If R-R intervals for thatchannel are determined to be stable, YES in Block 348, the signal isidentified as likely being associated with VT, which is then verified bydetermining whether the signal is in a VT shock zone, Block 352,described below.

If noise was not likely for both of the channels, No in Block 346, i.e.,both channels are determined to be clean channels, a determination ismade whether the signal for both channels is more likely associated witha VT event or with a VF event by determining whether the signal for bothchannels includes R-R intervals that are regular and can be thereforeclassified as being relatively stable, Block 356. The determination inBlock 356 of whether the R-R intervals are determined to be relativelystable may be made using the method described in U.S. Pat. No. 7,894,894to Stadler et al., incorporated herein by reference in it's entirety. Ifthe R-R intervals are determined not to be relatively stable, NO inBlock 356, the signal for both channels is identified as likely beingassociated with VF, which is then verified by determining whether thesignal for each channel is in a VF shock zone, Block 360, describedbelow. If R-R intervals for both channels are determined to be stable,YES in Block 356, the signal is identified as likely being associatedwith VT, which is then verified by determining, based on both channels,whether the signal is in a VT shock zone, Block 358.

A VF shock zone is defined for each channel ECG1 and ECG2 based on therelationship between the calculated low slope content and the spectralwidth associated with the channel, as described in U.S. patentapplication Ser. No. 14/255,159 to Zhang, incorporated herein byreference in it's entirety.

A determination is made for each channel ECG1 and ECG2 as to whether thelow slope content for that channel is less than both the first boundary502 and the spectral width is less than the second boundary 504, i.e.,the low slope content is less than −0.0013×spectral width+0.415, and thespectral width is less than 200. For example, once the event isdetermined to be associated with VF, i.e., the intervals for bothchannels are determined to be irregular, No in Block 356, adetermination is made that channel ECG1 is in the VF shock zone, Yes inBlock 360, if, for channel ECG1, both the low slope content is less thanthe first boundary 502 and the spectral width is less than the secondboundary 504. The three second segment for that channel ECG1 is thendetermined to be shockable, Block 363 and the associated buffer for thatchannel is updated accordingly. If either the low slope content for thechannel is not less than the first boundary 502 or the spectral width isnot less than the second boundary, the channel ECG1 is determined not tobe in the VF shock zone, No in Block 360, the three second segment forthat channel ECG1 is then determined to be not shockable, Block 365, andthe associated buffer is updated accordingly.

Similarly, a determination is made that channel ECG2 is in the VF shockzone, Yes in Block 362, if, for channel ECG2, both the low slope contentis less than the first boundary 502 and the spectral width is less thanthe second boundary 504. The three second segment for that channel ECG2is then determined to be shockable, Block 369 and the associated bufferfor that channel is updated accordingly. If either the low slope contentfor the channel is not less than the first boundary 502 or the spectralwidth is not less than the second boundary, the channel ECG2 isdetermined not to be in the VF shock zone, No in Block 362, the threesecond segment for that channel ECG2 is then determined to be notshockable, Block 367, and the associated buffer is updated accordingly.

During the determination of whether the event is within the VT shockzone, Block 358 of FIG. 4, the low slope content and the spectral widthis determined for each channel ECG1 and ECG2, as described above inreference to determining the VF shock zone. A determination is made asto which channel of the two signal channels ECG1 and ECG2 contains theminimum low slope content and which channel of the two signal channelsECG 1 and ECG2 contains the minimum spectral width. A first VT shockzone is defined based on the relationship between the low slope contentassociated with the channel determined to have the minimum low slopecontent and the spectral width associated with the channel determined tohave the minimum spectral width.

As described, during both the VF shock zone test, Blocks 360 and 362,and the VT shock zone test, Block 358, the test results for each channelECG1 and ECG2 as being classified as shockable or not shockable arestored in a rolling buffer containing the most recent eight suchdesignations, for example, for each of the two channels ECG1 and ECG2that is utilized in the determination of Block 356, as described below.

If only one of the two channels ECG1 and ECG2 is determined to becorrupted by noise, Yes in Block 346, a determination is made whetherthe signal for the channel not corrupted by noise, i.e., the “cleanchannel”, is more likely associated with a VT event or with a VF eventby determining whether the signal for the clean channel includes R-Rintervals that are regular and can be therefore classified as beingrelatively stable, Block 348. If the R-R intervals are determined not tobe relatively stable, NO in Block 348, the signal for the clean channelis identified as likely being associated with VF, which is then verifiedby determining whether the signal for the clean channel is in a VF shockzone, Block 350, described below. If R-R intervals for the clean channelare determined to be stable, YES in Block 348, the signal is identifiedas likely being associated with VT, which is then verified bydetermining whether the signal for the clean channel is in a VT shockzone, Block 352.

According to an embodiment of the present invention, in order todetermine whether the signal for the clean channel includes R-Rintervals that are regular and the clean channel can be thereforeclassified as being either relatively stable, Yes in Block 348, orrelatively unstable, No in Block 348, the device discriminates VT eventsfrom VF events in Block 348 by determining whether the relative level ofvariation in the RR-intervals associated with the clean channel isregular, as described in U.S. patent application Ser. No. 14/255,159 toZhang, incorporated herein by reference in it's entirety. For example,predetermined maximum and minimum intervals for the clean channel areidentified from the updated buffer of 12 RR-intervals, Block 342 of FIG.4. According to an embodiment of the present invention, the largestRR-interval and the sixth largest RR-interval of the twelve RR-intervalsare utilized as the maximum interval and the minimum interval,respectively.

The difference between the maximum RR-interval and the minimumRR-interval of the 12 RR-intervals is calculated to generate an intervaldifference associated with the clean channel. A determination is thenmade as to whether the interval difference is greater than apredetermined stability threshold, such as 110 milliseconds, forexample.

If the interval difference is greater than the stability threshold, theevent is classified as an unstable event, and therefore the cleanchannel is determined not to include regular intervals, No in Block 348,and a determination is made as to whether the signal associated with theclean channel is within a predetermined VF shock zone, Block 350 of FIG.4, described below. If the interval difference is less than or equal tothe stability threshold, the device determines whether the minimum RRinterval is greater than a minimum interval threshold, such as 200milliseconds, for example.

If the minimum interval is less than or equal to the minimum intervalthreshold, the event is classified as an unstable event, and thereforethe clean channel is determined not to include regular intervals, No inBlock 348, and a determination is made as to whether the signalassociated with the clean channel is within a predetermined VF shockzone, Block 350 of FIG. 4, described below. If the minimum interval isgreater than the minimum interval threshold, the device determineswhether the maximum interval is less than or equal to a maximum intervalthreshold, such as 333 milliseconds for example. If the maximum intervalis greater than the maximum interval threshold, the event is classifiedas an unstable event and therefore the clean channel is determined notto include regular intervals, No in Block 348, and a determination ismade as to whether the signal associated with the clean channel iswithin a predetermined VF shock zone, Block 350 of FIG. 4, describedbelow. If the maximum interval is less than or equal to the maximuminterval threshold, the event is classified as a stable event andtherefore the clean channel is determined to include regular intervals,Yes in Block 348, and a determination is made as to whether the signalassociated with the clean channel is within a predetermined VT shockzone, Block 352 of FIG. 4, described below.

The determination of whether the clean channel is within the VF shockzone, Block 350, is made based upon a low slope content metric and aspectral width metric, similar to the VF shock zone determinationdescribed above in reference to Blocks 360 and 362, both of which aredetermined for the clean channel using the method described above. Oncethe low slope content metric and a spectral width metric are determinedfor the clean channel, the determination of whether the clean channel isin the VF shock zone is made as described in U.S. Pat. No. 9,352,165 toZhang, incorporated herein by reference in its entirety, so that ifeither the low slope content for the clean channel is not less than thefirst boundary or the spectral width is not less than the secondboundary, the clean channel is determined not to be in the VF zone, Noin Block 350 and both channels are classified as not shockable, Block351, and the associated buffers are updated accordingly.

If the low slope content for the clean channel is less than the firstboundary and the spectral width is less than the second boundary, theclean channel is determined to be in the VF zone, Yes in Block 350. Adetermination is then made as to whether the channel determined to becorrupted by noise, i.e., the “noisy channel”, is within the VF shockzone, Block 354. If either the low slope content for the noisy channelis not less than the first boundary or the spectral width is not lessthan the second boundary, the noisy channel is determined not to be inthe VF zone, No in Block 354, the clean channel is classified asshockable and the noisy channel is classified as not shockable, Block355, and the associated buffers are updated accordingly.

If the low slope content for the noisy channel is less than the firstboundary and the spectral width is less than the second boundary, thenoisy channel is determined to be in the VF zone, Yes in Block 354, boththe clean channel and the noisy channel are classified as beingshockable, Block 353, and the associated buffers are updatedaccordingly.

Similar to the VT shock zone determination described above in referenceto Block 358, during the determination as to whether the clean channelis within the VT shock zone in Block 352, the low slope content and thespectral width is determined for the clean channel as described above inreference to determining the VF shock zone. The first VT shock zone isdefined based on the relationship between the low slope content and thespectral width associated with the clean channel and the second VT shockzone is defined based on the relationship between the low slope countand the normalized mean rectified amplitude associated with the cleanchannel. The normalized mean rectified amplitudes for the clean channelis the same as described above in reference to the noise detection testsof Block 344. For example, according to an embodiment of the presentinvention, the second VT shock zone is defined by a second boundary 526associated with the relationship between the low slope count and thenormalized mean rectified amplitude of the clean channel.

If both the low slope count is less than the first boundary and thenormalized mean rectified amplitude is greater than the second boundary,the clean channel is determined to be in the VT shock zone, Yes in Block352, both channels are classified as being shockable, Block 353, and theassociated buffers are updated accordingly. If the clean channel isdetermined to be outside the VT shock zone, No in Block 352, bothchannels are classified as being not shockable, Block 351, and theassociated buffers are updated accordingly.

According to an embodiment of the present disclosure, in addition to theclassification of the sensing channels ECG1 and ECG2 as being shockableor not shockable using a gross morphology analysis, as described in FIG.4, for example, the device also performs a beat-based analysis of thebeats within each of the three-second windows, Block 368, so that thedecision on state transitions (e.g. as to whether to transition from theconcerned operating state 304 to the armed operating state 306 in Block370, or from the armed state 306 to the shock state 308) is made basedon the results of both an analysis of the gross morphology of the signalin the three-second window or windows for each sensing channel ECG1 andECG2, and an analysis of the morphology of individual beats or R-wavesin the three-second window or windows for each sensing channel ECG1 andECG2, as described below. For a three-second segment to be classified asshockable, both the gross morphology and beat-based analysis have toclassify the same three-second segment as shockable.

According to an embodiment, the device also determines a confidencelevel measurement during the beat-based analysis, Block 368, todetermine whether the beat-based analysis may be corrupted by noise, andtherefore determine whether the beat-based classification is verified.In this way, the device performs two separate noise determinations ofthe same signal within the same sensing channels ECG1 and ECG2 for usein the state transition decision, one determination during the grossmorphology analysis, Block 342-346, and the second determination duringthe beat-based analysis, Block 368.

For example, according to an embodiment of the present invention, inorder to determine whether to transition from the concerned operatingstate 304 to the armed operating state 306, the device determineswhether a predetermined number, such as two out of three for example, ofthree-second segments for both channels ECG1 and ECG2 have beenclassified as being shockable during the gross morphology analysis,Blocks 353, 357, 363 and 369, and determines whether those three-secondsegments for both channels have also been classified as being shockableduring the beat-based analysis, and/or whether the beat-based analysisfor one or both of the channels may be corrupted by noise, Block 368. Ifthe predetermined number of three-second segments in both channels ECG1and ECG2 have been classified as shockable during both the grossmorphology analysis and the beat-based analysis and noise determination,the device transitions from the concerned state 304 to the armed state306, Yes in Block 370. When the device determines to transition from theconcerned state 304 to the armed state 306, Yes in Block 370, processingcontinues to be triggered by a three-second time out as is utilizedduring the concerned state 304, described above.

If the predetermined number of three-second segments in both channelsECG1 and ECG2 have not been classified as shockable during both thegross morphology analysis and the beat-based analysis, the device doesnot transition from the concerned state 304 to the armed state 306, Noin Block 370, and a determination as to whether to transition back tothe not concerned state 302 is made, Block 372. The determination as towhether to transition from the concerned state 304 back to the notconcerned state 302 is made, for example, by determining whether a heartrate estimate is less than a heart rate threshold level in both of thetwo channels ECG1 and ECG2, using the method for determining a heartrate estimate as described in U.S. Pat. No. 7,894,894 to Stadler et al.,incorporated herein by reference in it's entirety. If it is determinedthat the device should not transition to the not concerned state 302,i.e., either of the two heart rate estimates are greater than the heartrate threshold, No in Block 372, the process continues using the signalgenerated during a next three-second window, Block 341.

As described above, the determination of whether the sensing channelsECG1 and ECG2 are shockable or not shockable, Blocks 353, 355, 357, and363-369, is performed by analyzing the gross morphology of a sensedwaveform occurring within the three-second windows. The ECG signal issegmented into n-second intervals, i.e., 3 second intervals that areused for determining gross morphology features of the three-secondwaveform. In particular, the gross morphology features are determinedacross an n-second time interval without relying on R-wave sensing andare therefore features making up the whole waveform signal that can bedetermined from the ECG signal independent of individual cardiac signalsof the cardiac cycle, i.e., individual beats or R-waves contained withinthe three-second window that are within the entire three-second window.A single waveform in the n-second window begins at the start of thewindow, extends through entire window, ending at the end of thethree-second window so that a single morphology determination is madefor the single waveform included within the single three-second window.

On the other hand, multiple cardiac cycles, i.e, R-waves signals, areincluded within the three-second window, and therefore the n-secondwindow may start and end at any time point relative to each of theindividual R-wave signals irrespective of where an individual R-wavesignal starts and ends, so that multiple individual beat-baseddeterminations are made during the beat-based analysis for the multiplebeat waveforms included within the single three-second window.

Morphology features computed for the single waveform extending acrossthe n-second time period are referred to as “gross” morphology featuresbecause the features are characteristics of the single signal, extendingfrom the start to the end of the window, that is extracted, independentof cardiac cycle timing, from a time segment that includes multipleindividual cardiac cycles. In contrast, morphology features extractedfrom the ECG signal during a cardiac cycle are referred to as“beat-based” features. Beat-based features are determined from an ECGsignal segment over a time interval of one cardiac cycle of multiplecardiac cycles contained within a single three-second window. Beat-basedfeatures may be averaged or determined from multiple cardiac cycles butare representative of a single feature of the ECG signal during acardiac cycle. Determination of a beat feature is dependent onidentifying the timing of a cardiac cycle, or at least a sensed eventsuch as an R-wave, as opposed to determining gross features independentof the cardiac cycle over a time segment that is typically longer thanone cardiac cycle.

Therefore, as described above, in addition to performing the morphologyanalysis of the whole waveform within the three-second windowsassociated with each sensing channel ECG1 and ECG2, the device performsa beat-based analysis of the signal sensed simultaneously within bothchannels ECG1 and ECG2, and/or whether the beat-based analysis for oneor both of the channels is likely corrupted by noise Block 368. Duringthe beat-based analysis, individual beats located within a three-secondwindow are compared to a stored template, such as a normal sinus rhythmtemplate, for example, to determine whether individual beats should beclassified as a match beat or a non-match beat. The template may beinput within the device manually by a clinician through visual analysisof ECG signals, or may be generated by the device after being implantedin the patient. For example, according to one embodiment, the device maygenerate the template using a fourth order signal of a predeterminednumber of beats, as described in commonly assigned U.S. patentapplication Ser. No. 13/826,097, incorporated herein by reference init's entirety.

FIG. 5 is a flowchart of a method for performing beat-based analysisduring detection of arrhythmias in a medical device, according to anembodiment of the present disclosure. Therefore, as described above, inaddition to performing the morphology analysis of the whole waveformwithin the three-second windows associated with each sensing channelECG1 and ECG2, the device performs a beat-based analysis of the signalsensed simultaneously within both channels ECG1 and ECG2, Block 368 ofFIG. 4. In particular, as illustrated in FIG. 5, for each three-secondsensing window associated with the respective sensing channels ECG1 andECG2, the device locates a single beat, i.e., R-wave, of the multiplebeats in the three-second window, Block 400, and performs a beat-basedanalysis of the single beat, Block 402. According to an embodiment, forexample, during the beat-based analysis, Block 402, the device computesa normalized waveform area difference (NWAD) between the beat, alsoidentified herein as “the unknown beat”, and a predetermined beattemplate, such as a normal sinus rhythm template, for example, anddetermines whether the beat matches the template, Block 404, based onthe determined normalized waveform area difference, as described below.

Using the results of the comparison of the beat to the template, thedevice determines whether the beat is either a match beat or a non-matchbeat, Block 404, by determining whether the beat matches the sinusrhythm template within a predetermined percentage, such as 60 percent,for example. If the beat matches the template by the predeterminedpercentage or greater, Yes in Block 404, the beat is identified as amatch beat, Block 406. If the beat matches the template by less than thepredetermined percentage, No in Block 404, the beat is identified as anon-match beat, Block 408.

FIG. 6 is a flowchart of a method for aligning an ECG signal of anunknown beat with a known morphology template for beat-based analysisduring detection of arrhythmias in a medical device, according to anembodiment of the present disclosure. In order to perform the comparisonof the unknown beat with the template in Block 404 of FIG. 5 to identifythe beat as being either a match beat or a non-match beat, the unknownbeat must be aligned with the template. As illustrated in FIG. 6, duringalignment of the unknown beat with the template, Block 450, the deviceidentifies individual beats within the three-second window based ondetermined R-wave sense signals, Block 452, and for each beat stores npoints before and n points after the sample point on which the R-wavesense occurs. The 2n+1 sample points define an alignment window withinwhich an alignment point will be identified for alignment with theclinician input or device generated template, such as a normal sinusrhythm template, for example. In one embodiment, the alignment window is53 sample points centered on the R-wave sense point. These sample pointsare stored in a memory buffer at block 454.

Once the sample points are determined for the beat, the devicedetermines a fourth order difference signal for the beat from thebuffered signal sample data, Block 456. The maximum slope of the fourthorder difference signal is determined and compared to a maximum slopethreshold, e.g. approximately 136 analog-to-digital (A/D) conversionunits, Block 458. If the slope threshold is not met, No in Block 458,the signal may be rejected as a weak signal, no further analysis of thatbeat is performed, and the process continues with the next beat in thethree-second window, Block 452. If the maximum slope is greater than thethreshold, Yes in Block 458, indicating that at least one pulsecorresponding to an R-wave is likely to be present in the alignmentwindow, pulses associate with the individual beat within the alignmentwindow are identified, Block 460.

To identify pulses associated with the beat within the alignment window,pulse criteria may be established, such as having a pulse width equal toat least some minimum number of sample points and a pulse amplitude ofat least some minimum amplitude. The number of pulses identified, orlack thereof, within the alignment window may be used to reject a“cardiac cycle” as a noisy cycle or a weak signal. One or more pulses,including negative-going and positive-going pulses, may be identifiedaccording to amplitude and pulse width criteria. In some examples, apulse may be identified based on a slope, maximum peak amplitude(positive or negative), pulse width or any combination thereof. If athreshold number of pulses is identified within the alignment window,the cycle may be considered a noisy cycle. While not shown explicitly inFIG. 6, a noisy cycle may be flagged or rejected for use in morphologyanalysis.

After identifying all pulses from the fourth order difference signal inthe alignment window, a pulse having a maximum pulse amplitude andhaving the same polarity as a stored template alignment point isidentified, Block 462. The sample point having the maximum pulseamplitude (absolute value) that also matches the polarity of thetemplate alignment point is identified and defined as the unknown signalalignment point.

An alignment shift is computed, Block 464, as the difference in samplepoint number between the alignment point identified, Block 462, and thepreviously established template alignment point. The alignment shift isthe number of sample points that the unknown beat must be shifted inorder to align the unknown signal alignment point with the templatealignment point. The alignment shift is applied by shifting the unknownbeat sample points to align the unknown beat and the template over thealignment window, Block 466. The alignment shift may be applied to thefourth order difference signal itself if the template is stored as anensemble average of aligned fourth order difference signals or stored asthe fourth order difference signal of an ensemble average of aligned rawECG signals. The alignment shift may additionally or alternatively beapplied to the digitized raw signal sample points of the unknown signalwhen the template is the ensemble average of the raw signal samplepoints acquired during a known rhythm and aligned using the fourth orderdifference signal, as described in the template generation described incommonly assigned U.S. patent application Ser. No. 13/826,097,incorporated herein by reference in it's entirety. In another variation,the template may be the fourth order difference signal of ensembleaveraged raw signals, and the fourth order difference signal of theunknown raw signal is aligned with the fourth order difference template.

FIG. 7 is a flowchart of a method for computing a morphology metric todetermine the similarity between a known template aligned with anunknown cardiac cycle signal according to one embodiment. After aligningthe unknown beat and the template using the fourth order differencesignal alignment points, the morphology between the unknown beat and thetemplate is compared, Block 470. Numerous types of morphology analysiscould be used, such as wavelet analysis, comparisons of fiducial points(peak amplitude, zero crossings, maximum slopes, etc.) or othertechniques. In one embodiment, a NWAD is computed using a morphologyanalysis window that is a subset of, i.e. a number of sample points lessthan, the alignment window.

The operations performed by the device as described in conjunction withFIG. 7 may be performed on the aligned raw signal and correspondingtemplate and/or the aligned fourth order difference signal andcorresponding fourth order difference signal template.

As illustrated in FIG. 7, during the comparing of an individual beatwith the beat template, the device determines the R-wave width of theunknown signal, Block 472. In an illustrative embodiment, in order todetermine the R-wave width, the device determines an onset and an offsetpoint of the R-wave. During the determination of the onset and offset,the maximum positive pulse and the maximum negative of the fourth orderdifference signal are identified. The maximum positive pulse is anidentified pulse having positive polarity and maximum positive peakvalue; the maximum negative pulse is an identified pulse having negativepolarity and maximum absolute peak value. If the R wave has a positivepolarity in the raw ECG signal, the maximum positive pulse will precedethe maximum negative pulse on the 4^(th)-order difference waveform. Anonset threshold is set based on the amplitude of the maximum positivepulse and an offset threshold is set based on the amplitude of themaximum negative pulse. For example, one-eighth of the peak amplitude ofthe maximum positive pulse may be defined as the onset threshold and oneeighth of the negative peak amplitude of the maximum negative pulse maybe defined as the offset threshold.

The onset of the R-wave is identified as the first sample point to theleft of the maximum positive pulse (e.g. moving from the pulse peakbackward in time to preceding sample points) to cross the onsetthreshold. The offset of the R-wave is identified as the first samplepoint to the right of the maximum negative pulse crossing the offsetthreshold. The R-wave width is the difference between the onset samplepoint number and the offset sample point number, i.e. the number ofsampling intervals between onset and offset.

For an R-wave having a negative polarity on the raw waveform, themaximum negative pulse will precede the maximum positive pulse on thefourth order difference signal. As such, the onset threshold is set as aproportion of the maximum negative peak amplitude of the maximumnegative pulse of the fourth order difference signal, and the offsetthreshold is set as a proportion of the maximum positive peak amplitudeof the maximum positive pulse. The R-wave onset is detected as the firstsample point to cross the onset threshold when moving left (earlier intime) from the maximum negative peak. The R-wave offset is detected asthe first sample point to cross the offset threshold moving right (laterin time) from the maximum positive peak. The R-wave width is thedifference between the onset sample point and the offset sample point.This method of computing an R-wave width based on onset and offsetpoints identified from the fourth order difference signal is illustratedbelow in FIG. 9.

The device sets a morphology analysis window in response to the R-wavewidth determined from the fourth order difference signal, Block 474. Themorphology of the R-wave itself is of greatest interest in classifyingthe unknown beat. Processing time can be reduced by comparing only thesample points of greatest interest without comparing extra points, forexample baseline points or Q- or S-wave points, preceding or followingthe R-wave. The morphology analysis window is therefore a proportion ofthe sample points that is less than the total number of sample pointsaligned in the alignment window.

In one embodiment, different ranges of R-wave width measurements may bedefined for which different respective sample numbers will be used toset the morphology analysis window. For example, if the R-wave width isgreater than 30 sample intervals, the morphology analysis window is setto a first number of sample points. If the R-wave width is greater than20 sample intervals but less than or equal to 30 sample intervals, themorphology analysis window is set to a second number of sample pointsless than the first number of sample points. If the R-wave width is lessthan or equal to 20 sample points, the morphology analysis window is setto a third number of sample points less than the second number of samplepoints. Two or more R-wave width ranges may be defined, each with acorresponding number of sample points defining the morphology analysiswindow. At least one of the R-wave width ranges is assigned a number ofsample points defining the morphology analysis window to be less thanthe alignment window. In some embodiments all of the R-wave width rangesare assigned a number of sample points defining the morphology analysiswindow to be less than the alignment window.

In the example given above, the alignment window is 53 sample points. Ifthe R-wave width is greater than 30 sample intervals, the morphologywindow is defined to be 48 sample points. The morphology analysis windowmay include 23 points preceding the R-wave sense point, the R-wave sensepoint itself, and 24 points after the R-wave sense point. If the R-wavewidth is greater than 20 but less than or equal to 30 sample intervals,the morphology window is defined to be 40 sample points (e.g. 19 beforethe R-wave sense point and 20 after the R-wave sense signal). If theR-wave width is less than or equal to 20 sample intervals, the window isdefined to be 30 sample points (e.g. 14 before and 15 points after theR-wave sense point and including the R-wave sense point).

In other embodiments, the number of sample points in the morphologyanalysis window may be defined as a fixed number of sample pointsgreater than the R-wave width, for example the R-wave width plus 12sample points. In another example, the number of sample points definingthe morphology analysis window may be computed as the R-wave width plusa rounded or truncated percentage of the R-wave width. For example, themorphology analysis window may be defined as the R-wave width plus fiftypercent of the R-wave width (i.e. 150% of the R-wave width), up to amaximum of the total alignment window or some portion less than thetotal alignment window.

The morphology window is applied to both the unknown beat and thetemplate. With the template and unknown cardiac signal aligned withinthe alignment window, the same number of sample points taken prior toand after the unknown beat alignment point is taken prior to and afterthe template alignment point.

After setting the morphology analysis window, Block 474, a morphologymetric of the similarity between the unknown signal and the template,such as the normalized waveform area difference (NWAD), for example, iscomputed, Block 476. Different methods maybe used to compute a NWAD. Inan illustrative method, the NWAD is computed by normalizing the absoluteamplitude of each of the unknown beat sample points and the templatesample points within the morphology window by a respective absolutemaximum peak amplitude value. A waveform area difference is thencalculated by summing the absolute amplitude differences between eachaligned pair of normalized sample points in the unknown signal and inthe template over the morphology window.

This waveform area difference may be normalized by a template area. Thetemplate area is computed as the sum of all of the absolute values ofthe normalized template sample points in the morphology window. The NWADis then calculated as the ratio of the waveform area difference to thetemplate area. The NWAD for the aligned signals is stored.

This NWAD may be compared to a threshold to classify the unknown beat asmatching the template based on a high correlation between the unknownbeat and the template evidenced by a NWAD exceeding a match threshold.One or more NWADs may be computed for a given unknown beat. In theexample shown in FIG. 7, additional NWADs may be computed by shiftingthe aligned template relative to the already aligned unknown signal byone or more sample points, Block 478. In one embodiment, the template isshifted by one sample point to the right, two sample points to theright, one sample point to the left and two sample points to the left toobtain five different alignments of the template and unknown signal. Foreach template alignment, i.e. with alignment points aligned, and withtemplate and unknown signal alignment points shifted relative to eachother by one point and two points in each direction, a NWAD is computed,Block 480. In this way, five NWADs are computed to measure thesimilarity between the unknown beat and the template (in aligned andshifted positions).

The device selects the NWAD having the greatest value as the morphologymetric for the unknown beat, which is then compared to the matchthreshold, Block 482, to classify the unknown beat as being either amatch beat or a non-match, Block 484, as described above in Blocks404-408 of FIG. 5.

FIG. 8 is an exemplary plot of alignment of an unknown beat and atemplate for computing a normalized waveform area difference duringbeat-based analysis, according to one embodiment. As illustrated in FIG.8, the unknown raw ECG signal 502 and the raw ECG signal template 504(ensemble average of n raw signals aligned using fourth order differencesignal) are used for determining a morphology match metric over amorphology analysis window 512. The width of the morphology analysiswindow 512 and the alignment of the unknown signal 502 and template 504are based on analysis of fourth order difference.

The raw ECG signal 502 is aligned with a template alignment point 506 ofthe template 504 of the raw ECG signal established during NSR,identified from an ensemble averaged fourth order difference signal asthe maximum absolute pulse amplitude value. An unknown signal alignmentpoint 508 is identified from the fourth order difference signal of theunknown raw ECG signal 502. The unknown signal alignment point 508 isthe maximum absolute pulse amplitude value having the same polarity asthe template alignment point 506.

After aligning the template 504 with the unknown raw ECG signal 502 overan alignment window 510, a morphology window 512 is set. The morphologywindow 512 is a subset of, i.e. shorter than or fewer sample pointsthan, the alignment window 510. The morphology window 512 is set basedon an R-wave width measured from the fourth order difference signal ofthe unknown signal as described below in conjunction with FIG. 9. Themorphology analysis window 512 is set in response to the R-wave widthmeasurement as some sample number greater than the R-wave width, asdescribed above.

The device determines a template area 514 as the sum of all of thenormalized absolute values of the template sample points within themorphology analysis window 512. The values are normalized by theabsolute value of the maximum amplitude of the template. The waveformarea difference 516 is computed as the summation of the absolute valuesof the differences between the aligned normalized absolute values of theunknown ECG signal sample points and the normalized absolute values ofthe template sample points. The NWAD is determined by taking the ratioof the waveform area difference 516 to the template area 514, which isthen used in the determination, Block 404, of whether the unknown beatis a match beat, Block 406, or a non-match beat, Block 408, in FIG. 5.

FIG. 9 is an exemplary plot illustrating a technique for determining anR-wave width and computing a normalized waveform area difference duringbeat-based analysis, according to another embodiment. In the exampleillustrated in FIG. 9, a fourth order difference signal 520 of theunknown raw ECG signal is aligned with a fourth order difference signaltemplate 522 for determining a morphology match metric over a morphologyanalysis window 530.

The unknown fourth order difference signal 520 is derived from theunknown raw ECG signal sensed by the device and is aligned with thefourth order difference template 522 established during NSR. Thetemplate alignment point 524 is identified as the maximum absolute pulseamplitude value of the fourth order difference template. The unknownsignal alignment point 526 is identified as the maximum absolute pulseamplitude value having the same polarity as the template alignment point524. The unknown fourth order difference signal 520 is shifted over thealignment window 528 by an alignment shift required to align the unknownsignal alignment point 526 with the template alignment point 524 asshown.

After aligning the template 522 with the unknown fourth order differencesignal 520 over alignment window 528, a morphology window 530 is set.The morphology window 530 is a subset of the alignment window 528 and isbased on an R-wave width 532 measured from the unknown fourth orderdifference signal 520.

In order to determine the R-wave width 532, the device determines thedifference between an R-wave onset point 534 and an R-wave offset point536 of the fourth order difference signal 520 of the unknown beat. Inorder to determine an R-wave onset point 534, the device determines amaximum positive pulse peak amplitude 538, and sets an onset threshold540 as a proportion of the maximum positive pulse peak amplitude 538. Inone embodiment, the device sets the onset threshold 540 as one-eighth ofthe maximum positive pulse peak amplitude 538. The onset point 534 isidentified as the first point to the left of the maximum positive pulsepeak crossing the onset threshold 540, i.e. equal to or greater than theonset threshold 540.

The device sets an offset threshold 542 as a proportion of a maximumnegative pulse peak amplitude 544, and the offset point 536 isidentified as the first point crossing the offset threshold 542 to theright of the maximum negative pulse. The device determines the R-wavewidth 532 as being the difference between the onset point 534 and theoffset point 536. The morphology analysis window 530 is set in responseto the R-wave width measurement as some sample number greater than theR-wave width 532, as described previously.

In other examples, the maximum negative pulse may occur earlier in thealignment window than the maximum positive pulse. If this is the case,the onset threshold is set as a proportion of the maximum negative pulsepeak amplitude and the onset point is determined as the first pointcrossing the onset threshold to the left of the maximum negative peak.Likewise, the offset threshold is set as a proportion of the maximumpositive pulse peak amplitude, and the offset point is determined as thefirst point to the right of the maximum positive pulse to cross theoffset threshold.

The morphology analysis window 530 may be centered on an R-wave sensesignal. In some embodiments, the morphology analysis window 530,determined from the fourth order difference signal 520, is applied tothe unknown raw ECG signal aligned with a raw ECG signal template, forexample analysis window 512 as shown in FIG. 8. The morphology matchmetric is determined from the raw ECG signal 502 and template 504. Inthe example illustrated in FIG. 9, the morphology analysis window 530 isapplied to the fourth order difference signal 520; the morphology matchmetric is determined from the fourth order difference signal 520 andfourth order difference template 522.

The template area 546 is computed as the sum of all of the normalizedabsolute values of the template sample points within the morphologywindow 530. The values are normalized by the absolute value of themaximum amplitude of the template 522 (in this example point 526). Thedevice determines the waveform area difference 548 as the summation ofthe absolute differences between the aligned normalized absolute valuesof the unknown fourth order difference signal sample points and thenormalized absolute values of the template sample points. The NWAD isdetermined by the device as the ratio of the waveform area difference548 and the template area 546, and is compared to a match threshold toclassify the unknown beat corresponding to the fourth order differencesignal 520 as being either a match beat or a non-match beat, Blocks 406and 408 of FIG. 5.

Returning to FIG. 5, once the individual beat is identified as beingeither a match beat, Block 406, or a non-match beat, Block 408, usingthe normalized waveform area difference analysis described above, thedevice determines whether the individual beat may be corrupted, such asby noise, for example, thereby reducing the level of confidence in thedetermination that the beat is either a match beat, Block 406, or anon-match beat, Block 408. Based on the determined level of confidence,the device may determine that the beat should be discarded in thebeat-based shockable/not shockable analysis for the three-second window,as described below.

If the beat confidence threshold is satisfied, Yes in Block 410, thebeat is considered a high confidence beat and therefore is identified asa beat that should not be discarded, Block 412. If the beat confidencethreshold is not satisfied, No in Block 410, the beat is considered alow confidence beat and therefore is identified as a beat that should bediscarded, Block 414. Once the beat is identified as either being a highconfidence beat, Block 412, or a low confidence beat, Block 414, thedevice determines whether the determination has been made for all of thebeats in the three-second window, Block 416. If the determination hasnot been made for all of the beats in the three-second window, theprocess of identifying a beat as being either a match beat or anon-match beat and a high confidence beat or a low confidence beat,Blocks 400-414, is repeated for the next beat.

FIG. 10 is a flowchart of a method for determining an individual beatconfidence during beat-based analysis, according to one embodiment. Inorder to determine whether the beat confidence threshold is satisfied inBlock 410 of FIG. 5, the device determines a narrow pulse count, i.e.,pulse number, for the plurality of pulses associated with the beat usingparameters previously determined during the normalized waveform areadifference analysis in Block 402, described above.

For example, in order to determine the narrow pulse count for eachindividual beat, the device determines, for each individual pulse of thepulses identified in the alignment window for the beat during thealignment of the unknown beat with the template, Block 460 of FIG. 6,whether the width of the pulse is less than a predetermined threshold.In particular, as illustrated in FIG. 10, the device gets a single pulseof the identified pulses for the beat, Block 600, determines a pulsewidth associated with the pulse, Block 6022, and determines whether thepulse width is less than or equal to a pulse width threshold, Block 604.

In addition to determining whether the pulse width of the individualpulse is less than or equal to the pulse width threshold, Yes in Block604, the device also determines whether the absolute amplitude of thepulse is greater than an amplitude threshold, Block 606. According to anembodiment, the pulse width threshold may be set as 23 milliseconds, forexample, and the amplitude threshold is set as a fraction, such as oneeighth, for example, of the maximum slope used in the determination ofwhether the slope threshold was met during the aligning of the beat withthe template, Block 458 of FIG. 6.

While the pulse width determination, Block 604, is illustrated asoccurring prior to the amplitude threshold determination, Block 606, itis understood that the sequence of the determinations of Blocks 604 and606 is not overriding. Therefore, if either the pulse width of theindividual pulse is not less than or equal to the pulse width threshold,No in Block 604, or the absolute amplitude of the pulse is not greaterthan the amplitude threshold, No in Block 606, the pulse is determinednot to be included in the narrow pulse count. The device continues bydetermining whether the determination of whether the number of pulsessatisfying the narrow pulse count parameters has been made for all ofthe identified pulses (Block 460 of FIG. 6) for the beat, Block 610. Ifthe determination has not been made for all of the identified pulses, Noin Block 610, the device identifies the next pulse, Block 600, and theprocess of determining a narrow pulse count for that beat, Blocks602-608, is repeated for the next pulse.

If both the pulse width of the individual pulse is less than or equal tothe pulse width threshold, Yes in Block 604, and the absolute amplitudeof the pulse is greater than the amplitude threshold, Yes in Block 606,the number of pulses satisfying the width and amplitude thresholds forthe individual beat, i.e., the narrow pulse count, is increased by one,Block 608.

Once the determination has been made for all of the identified pulsesassociated with the beat, Yes in Block 610, the device sets the narrowpulse count for the beat, Block 612, equal to the resulting updatednarrow pulse count, Block 608. In this way, the narrow pulse count forthe beat is the total number of pulses of the identified pulses for thebeat that satisfy both the width threshold, i.e., the number of pulsesthat have a pulse width less than 23 milliseconds, and the amplitudethreshold, i.e., the number of pulses that have an absolute amplitudegreater than one eighth of the maximum slope used in the determinationof whether the slope threshold was met during the aligning of the beatwith the template, Block 456 of FIG. 6. The final narrow pulse countfrom Block 612 is then used by the device in the determination ofwhether the beat confidence threshold is satisfied for the beat, Block410 of FIG. 5.

Returning to FIG. 5, when determining whether the beat confidencethreshold has been satisfied for the beat, the device determinescompares the narrow pulse count for the beat obtained from Block 612 ofFIG. 10 to a narrow pulse count threshold, such as 5, for example. Ifthe narrow pulse count is less than the narrow pulse count threshold,the beat confidence threshold is satisfied, Yes in Block 410, the beatis considered a high confidence beat and therefore is identified as abeat that should not be discarded, Block 412. If the narrow pulse countis not less than the narrow pulse count threshold, the beat confidencethreshold is not satisfied, No in Block 410, the beat is considered alow confidence beat and therefore is identified as a beat that should bediscarded, Block 414.

Once the determination of the beat being either a match beat or anon-match beat, and either a high confidence or a low confidence beathas been made for all of the beats in the three-second window, Yes inBlock 416, a determination is made as to whether the number of non-matchbeats in the three-second window that are also high confidence beats isgreater than a non-match threshold, Block 418. According to anembodiment of the disclosure, the non-match threshold is set as apredetermined percentage, such as 75 percent for example, so that if thenumber of individual beats in the three-second window that areidentified as being non-match beats is greater than 75 percent of thenumber of all of the beats in the window, Yes in Block 418, thethree-second window is identified as being shockable based on thebeat-based analysis, Block 420.

On the other hand, if the number of individual beats in the three-secondwindow that are identified as being both non-match beats and highconfidence beats is not greater than 75 percent of the number of all ofthe beats in the window, No in Block 418, the three-second window isidentified as being not shockable based on the beat based analysis,Block 422. The beat-based analysis determination of the three-secondwindows as being shockable 420 or not shockable, Block 422 is then usedin combination with the waveform morphology analysis of both of thethree-second windows being shockable, Blocks 353, 357, 363 and 369 orboth not shockable, Blocks 351, 355, 359, 365 and 367 to determinewhether to transition to the next state, Block 370, as described above.

FIG. 11 is an exemplary plot illustrating determining pulses for a beatwithin a window during a beat-based analysis according to an embodimentof the disclosure. As illustrated in FIG. 11, the device senses eachindividual R-wave 570 occurring within a three-second window, determinesa morphology window 512, and determines a number of pulses, i.e., pulsecount, associated with the R-wave 570 from the fourth order differenceof the R-wave 572 within the morphology window 512 for use indetermining a beat confidence for the R-wave 570, as described above.For example, in response to the fourth order difference 572 of thesensed R-wave 570, the device determines there are eight pulses P1-P8associated with the R-wave 570. Pulses P1, P3, P5 and P7 are positivepulses and P2, P4, P6 and P8 are negative pulses, with each pulse P1-P8having a pulse width 574 defined by zero-crossings of the pulses with abaseline 576, and a pulse amplitude 578 defined between a pulse peak 580and the baseline 576. In this way, the device uses the determined pulsesP1-P8 and their associated pulse width 574 and pulse amplitude 578 todetermine a narrow pulse count, as described above.

FIG. 12 is a flowchart of a method for acquiring beats for generating atemplate according to an embodiment of the disclosure. As illustrated inFIG. 12, in order to determine desirable beats to be utilized duringtemplate generation, the device identifies beats during sensing of thecardiac signal along each sensing vector ECG1 and ECG2, Block 700, anddetermines whether the device is in the not concerned operating state302, Block 702. If the device is not in the not concerned operatingstate, No in Block 702, the corresponding sensed beat is ignored as acandidate beat for generating a template, and the process is repeatedwith the next beat, Block 700. If the device is in the not concernedoperating state, Yes in Block 702, the device determines whether thebeats for each sensing vector ECG1 and ECG2 are within a predeterminedrelative threshold, Block 704.

For example, according to one embodiment, in order to determine whethera beat sensed for one sensing vector ECG1 is within a relative thresholdof a beat simultaneously sensed in the other sensing vector ECG2, thedevice compares the sensing marker associated with the sensing of thebeat sensed for one sensing vector ECG1 with the beat sensed for theother sensing vector ECG2. If the difference between the values of thetwo sensing markers are within a predetermined range, such as within 60ms or less of each other, for example, the beats are determined to bewithin the relative threshold, Yes in Block 704. If the differencebetween the values of the two sensing markers are not within thepredetermined range, i.e., the difference is greater than 60 ms, thebeats are determined not to be within the relative threshold, No inBlock 704, and the current beats are discarded and the process isrepeated with the next beat, Block 700.

In this way, comparing the difference between sensing marker values forsimultaneously sensed beats sensed by the two sensing vectors, thedevice addresses possible instances of oversensing by avoidingoversensed beats that may occur due to P-wave, T-wave, wide QRS, ornoise/artifacts within one of the sensing vectors but not the othersensing vector. If the simultaneously sensed beats form the two sensingvectors are determined to be within the relative threshold, Yes in Block704, the device determines whether RR-intervals forming the current beatsimultaneously sensed for each sensing vector, Block 706, are within apredetermined interval threshold, Block 708. The interval threshold ischosen so as to insure that the beats used to generate the template areacquired during instances of the patient having a slow heart rate, suchas less than 100 beats per minute, for example.

FIG. 12A is a schematic diagram of detection of simultaneously sensedR-waves sensed along two sensing vectors according to an embodiment ofthe disclosure. As illustrated in FIGS. 12 and 12A, a cardiac signal 701is sensed along both of the two sensing vectors ECG1 and ECG2, and thedevice determines that a sensed R-wave 709 sensed along one sensingvector ECG1 and a sensed R-wave 711 sensed along the other sensingvector ECG2 are simultaneously sensed when a difference 707 between theR-waves 709 and 711 is less than the relative threshold, as describedabove. In order to determine an RR-interval associated with currentlysensed simultaneously sensed RR intervals, Block 700, the devicedetermines previous simultaneously sensed R-waves in the two sensingvectors, R-wave 703 and 705, and determines, separately for each sensingvector ECG1 and ECG2, whether a resulting interval 713 associated withthe simultaneously sensed R-waves 703, 705, 709 and 711 is less than theinterval threshold, block 708.

If the RR-interval 713 forming the current simultaneously sensed beats703, 705, 709 and 711 for each sensing vector, Block 706, is not withinthe predetermined interval threshold, No in Block 708, i.e., not lessthan 100 beats per minute, the current beats are discarded and theprocess is repeated with the next beat, Block 700. On the other hand, ifthe RR-interval forming the current simultaneously sensed beats 705,707, 709 and 711 is within the predetermined interval threshold, Yes inBlock 708, the device determines, for each sensing vector ECG1 and ECG2whether the maximum absolute pulse amplitude value 524 determined asdescribed above for both the beat from the first sensing vector ECG1 andthe beat from the second sensing vector ECG2, Block 710, are greaterthan a maximum amplitude threshold, Block 712, such as 50 μV, forexample.

If the maximum amplitudes for both sensing vectors are not determined tobe greater than the amplitude threshold, No in Block 712, the currentbeats are discarded and the process is repeated with the next beat,Block 700. If the maximum amplitude for only one sensing vector isdetermined to be greater than the amplitude threshold, Yes in Block 712,the sensing channel not satisfying the amplitude threshold is discarded,and the device determines whether the sensing channel satisfying theamplitude threshold is a clean channel, i.e., not noisy, Block 714, andif the sensing channel satisfying the amplitude threshold is a cleanchannel, No in Block 714, the beat for that channel is determined to bea qualified beat, Block 716, for generating a template, as describedbelow. If the sensing channel satisfying the amplitude threshold is nota clean channel, the beat for that channel is also discarded and theprocess is repeated with the next beats, Block 700. For example, inorder to determine whether the individual sensing channel ECG1 and ECG2is noisy in Block 714, the device determines whether the number ofnarrow pulses determined in a narrow pulse count described above forthat sensing channel or channels, is less than a pulse count threshold,such as 6 pulses for example.

If the maximum amplitudes for both sensing vectors are determined to begreater than the amplitude threshold, Yes in Block 712, the devicedetermines whether both sensing channels are clean channels, Block 714,and if one channel is clean and the other channel is not, the beatassociated with the clean channel is identified as a qualified beat,Block 716, and the other beat is discarded and the process is repeatedwith the next beats. If the maximum amplitudes for both sensing vectorsare determined to be greater than the amplitude threshold, Yes in Block712, and both are determined to be clean, No in Block 714, both beatsare identified as being qualified beats, Block 716, for generating atemplate, as described below.

If both sensing channels are determined to satisfy the amplitudethreshold, Yes in block 712, but both are determined not to be cleanchannels, Yes in Block 714, the current beats are discarded and theprocess is repeated with the next beat, Block 700. In this way, thedetermination of whether the amplitude of the beats in the two channelsare greater than the amplitude threshold, Block 712 and thedetermination of whether the channels are clean, Block 714, is performedindividually for both sensing vectors.

FIG. 13 is a flowchart of generating a template according to anembodiment of the disclosure. Using the method described above in FIG.12 to identify qualified beats for each sensing vector, Block 716, thedevice obtains a qualified beat, Block 718, and determines a subgroup inwhich to place the current identified qualified beat, Block 720. Oncesubgroups have been determined in response to a predetermined number ofsubgroups within a predetermined time period, No in Block 722, such as15 qualified beats occurring with 60 seconds, for example, the devicedetermines whether one of the resulting subgroups is greater than orequal to a subgroup threshold, Block 724. If one of the resultingsubgroups is not greater than or equal to the subgroup threshold, No inBlock 724, the process is repeated using the next predetermined numberof qualified beats, Block 718. For example, according to one embodiment,the subgroup threshold may be set as 10 beats that are determined to bematched beats based on the beat-based morphology matching scheme usingthe normalized waveform area difference described above device.

If one of the resulting subgroups is determined to be greater than orequal to the subgroup threshold, Yes in Block 724, the template isgenerated using the 10 beats populating the subgroup, Block 726.According to one embodiment, the template is generated in Block 726using the ensemble averaging, described above, of those 10 beats.

FIG. 14 is a schematic diagram of determining of subgroups for qualifiedbeats during generation of a template, according to an embodiment of thedisclosure. As illustrated in FIG. 14, during placement of qualifiedbeats within subgroups, Blocks 718-722 of FIG. 13, the first determinedqualified beat, Yes in Block 730, is placed within a first subgroup, andsince it is the first beat positioned within the subgroup, the beat isidentified as the subgroup template beat, Block 732. The next determinedqualified beat, Block 728, is then compared to the template beat of thefirst subgroup, Block 734, using the NWAD scheme described above. Inparticular, a determination is made as to whether the determined matchbetween the second beat and the template beat of the first subgroup isgreater than a predetermined match threshold, such as 60 percent forexample.

If the second qualified beat matches the template beat of the firstsubgroup, Yes in Block 734, the beat is positioned within the firstsubgroup Block 736. If the second qualified beat does not match thetemplate beat of the first subgroup, No in Block 734, a determination ismade as to whether a second subset of beats has been created, Block 738.If a second subset of beats has not been created, No in Block 738, thebeat is placed within a second subgroup, and since it is the first beatpositioned within the second subgroup, the beat is identified as thesecond subgroup template beat, Block 740.

Once the second qualified beat is either placed in the first subgroupBlock 736 or the second subgroup, Block 740, the third qualified beat iscompared to the template beat of the first subgroup, and a determinationis made as to whether the NWAD determined between the third beat and thetemplate beat of the first subgroup is greater than the match threshold,Block 734. If the third qualified beat matches the template beat of thefirst subgroup, Yes in Block 734, the beat is positioned within thefirst subgroup, Block 736. If the third qualified beat does not matchthe template beat of the first subgroup, No in Block 734, the beat iscompared to the template beat of the second subgroup, and adetermination is made as to whether the NWAD determined between thethird beat and the template beat of the second subgroup is greater thanthe match threshold, Block 742. If the third qualified beat matches thetemplate beat of the second subgroup, Yes in Block 742, the beat ispositioned within the second subgroup, Block 744. If the third qualifiedbeat does not match the template beat of the second subgroup, No inBlock 742, a determination is made as to whether a third subgroup hasbeen created, Block 746. Since a third subgroup has not been created, Noin Block 746, the third beat is placed within a third subgroup, andsince it is the first beat positioned within the third subgroup, thebeat is identified as the third subgroup template beat, Block 748.

Once the third qualified beat is either placed in the first subgroup,Block 736, the second subgroup, Block 744, or as the template beat ofthe third subgroup, Block 748, the fourth qualified beat, Block 728, iscompared to the template beat of the first subgroup, and a determinationis made as to whether the NWAD determined between the fourth beat andthe template beat of the first subgroup is greater than the matchthreshold, Block 734. If the fourth qualified beat matches the templatebeat of the first subgroup, Yes in Block 734, the beat is positionedwithin the first subgroup, Block 736. If the fourth qualified beat doesnot match the template beat of the first subgroup, No in Block 734, ifthe second subset group was created by the second beat or the thirdbeat, Block 740, the beat is compared to the template beat of the secondsubgroup, and a determination is made as to whether the NWAD determinedbetween the fourth beat and the template beat of the second subgroup isgreater than the match threshold, Block 742. If the fourth qualifiedbeat matches the template beat of the second subgroup, Yes in Block 742,the beat is positioned within the second subgroup, Block 744.

If the fourth qualified beat does not match the template beat of thesecond subgroup, No in Block 742, if the third subset group was createdby the third beat, Block 746, the beat is compared to the template beatof the third subgroup, and a determination is made as to whether theNWAD determined between the fourth beat and the template beat of thethird subgroup is greater than the match threshold, Block 750. If thefourth qualified beat matches the template beat of the third subgroup,Yes in Block 750, the beat is positioned within the third subgroup,Block 752. If the fourth qualified beat does not match the template beatof the third subgroup, No in Block 750, a determination is made as towhether a fourth subgroup has been created, Block 754. Since a fourthsubgroup has not been created, No in Block 754, the fourth beat isplaced within a fourth subgroup, and since it is the first beatpositioned within the fourth subgroup, the beat is identified as thethird subgroup template beat, Block 756.

Once the fourth qualified beat is either placed in the first subgroup,Block 736, the second subgroup, Block 744, the third subset group, Block752, or as the template beat of the fourth subgroup, Block 756, thedevice gets the fifth qualified beat, Block 728, and compares the fifthbeat to the template beat of the first subgroup, and a determination ismade as to whether the NWAD determined between the fourth beat and thetemplate beat of the first subgroup is greater than the match threshold,Block 734. If the fifth qualified beat matches the template beat of thefirst subgroup, Yes in Block 734, the beat is positioned within thefirst subgroup, Block 736. If the fifth qualified beat does not matchthe template beat of the first subgroup, No in Block 734, if the secondsubset group was created by the one of the prior beats, Block 740, thefifth beat is compared to the template beat of the second subgroup, anda determination is made as to whether the NWAD determined between thefourth beat and the template beat of the second subgroup is greater thanthe match threshold, Block 742.

If the fifth qualified beat matches the template beat of the secondsubgroup, Yes in Block 742, the beat is positioned within the secondsubgroup, Block 744. If the fifth qualified beat does not match thetemplate beat of the second subgroup, No in Block 742, and if the thirdsubset group was created by one of the prior beats Block 746, the fifthbeat is compared to the template beat of the third subgroup, and adetermination is made as to whether the NWAD determined between thefifth beat and the template beat of the third subgroup is greater thanthe match threshold, Block 750. If the fifth qualified beat matches thetemplate beat of the third subgroup, Yes in Block 750, the beat ispositioned within the third subgroup, Block 752. If the fifth qualifiedbeat does not match the template beat of the third subgroup, No in Block750, and if the fourth subset group was created by the fourth beat,Block 756, the fifth beat is compared to the template beat of the fourthsubgroup, and a determination is made as to whether the NWAD determinedbetween the fifth beat and the template beat of the fourth subgroup isgreater than the match threshold, Block 758. If the fifth qualified beatmatches the template beat of the fourth subgroup, Yes in Block 758, thebeat is positioned within the fourth subgroup, Block 760.

If the fifth qualified beat does not match the template beat of thefourth subgroup, No in Block 758, the beats are discarded and theprocess is repeated with newly obtained qualified beats. The process iscontinued with subsequent beats until either 15 beats have beenevaluated and placed in one of the subsets, Blocks 736, 744, 752, 760,or discarded, or a timer has expired, i.e., 60 seconds for example. Adetermination is then made as to whether one of the subsets, Blocks 736,744, 752 760, contains a threshold number of beats, Block 762, such as10 beats for example. If none of the subsets contain the thresholdnumber of beats, No in Block 762, the process is determined for the nextpredetermined number of beats or until the timer expires. If one of thesubsets contain the threshold number of beats, Yes in Block 762, thedevice utilizes the 10 beats to generates a template, Block 764, byensemble-averaging the beats, as described above, aligning the beatswith the first beat in the subgroup.

In this way, the device sets the first qualified-beat as the firstsubgroup template (i.e., the first beat in the subgroup), and if thesecond qualified beat matches (NWAD>=60%) the first subgroup templatebeat, then, the second beat is placed in the first subgroup. If thesecond beat does not match the first subgroup template beat, then thesecond beat is placed in the second subgroup as the second subgrouptemplate. If the third beat matches the first subgroup template beat,then the third beat is placed in the first subgroup. If the third beatdoes not match the first subgroup template beat and if the secondsubgroup template does not exist (because the second beat was placed inthe first subgroup) the third beat is placed in the second subgroup asthe second subgroup template. Otherwise, if the second subgroup templatealready exists, and the third beat matches the second subgroup template,the third beat is placed in the second subgroup, or if the third beatdoesn't match the second subgroup template, then the third beat isplaced in the third subgroup as the third subgroup template.

Next, if the fourth beat matches the first subgroup template, then theforth beat is placed in the first subgroup. If the fourth beat does notmatch the first subgroup template beat and if the second subgrouptemplate does not exist (because the second or third beat was placed inthe first subgroup) the fourth beat is placed in the second subgroup asthe second subgroup template. Otherwise, if the second subgroup templatealready exists, and the fourth beat matches the second subgrouptemplate, the fourth beat is placed in the second subgroup. If thefourth beat doesn't match the second subgroup template, and if the thirdsubgroup template does not exist (because the third beat was placed inthe first or second subgroup) the fourth beat is placed in the thirdsubgroup as the third subgroup template. Otherwise if the third subgrouptemplate already exists (because the third beat was placed in the thirdsubgroup) and the fourth beat matches the third subgroup template, thefourth beat is placed in the third subgroup. If the fourth beat doesn'tmatch the third subgroup template, then the fourth beat is placed in thefourth subgroup as the fourth subgroup template.

Next, if the fifth beat matches the first subgroup template, then thefifth beat is placed in the first subgroup. If the fifth beat does notmatch the first subgroup template, then if the second subgroup templatedoes not exist, the fifth beat is placed in the second subgroup as thesecond subgroup template. Otherwise, if the second subgroup templatealready exists, and the fifth beat matches the second subgroup template,the fifth beat is placed in the second subgroup. If the fifth beatdoesn't match the second subgroup template, then if the third subgrouptemplate does not exist, the fifth beat is placed in the third subgroupas the third subgroup template. If the third subgroup template alreadyexists, the fifth beat is compared to the third subgroup template, andif the fifth beat matches the third subgroup template, then the fifthbeat is paced in the third subgroup. If the fifth beat matches the thirdsubgroup template, then if the fourth subgroup template does not exist,the fifth beat is placed in the fourth subgroup as the fourth subgrouptemplate. Otherwise, if the fourth subgroup template already exists, andthe fifth beat matches the fourth subgroup template, then the fifth beatis placed in the fourth subgroup. If the fifth beat does not match thefourth subgroup template, then the fifth beat is discarded, and theacquisition process is restarted. In another embodiment, if the fifthbeat does not match the fourth subgroup template, the fifth beat maymerely be discarded and the process repeated with the next beat until 15beats have been analyzed or the timer has expired.

Assuming beats 1-5 are placed in one of the four subgroups, the processis repeated for beats 6-15 until one of the subgroups is populated withten beats, and the ten beats are then used in the ensemble averagingscheme to generate a template, as described above, by aligning the lastnine beats with the first beat, using the alignment process describedabove, for example, to build the template.

It is understood that while the features in the above describedflowcharts are described as being performed in a certain sequence, theorder in performing the features of the flow charts may be differentfrom the order described. Thus, a method and apparatus for beatacquisition during template generation have been presented in theforegoing description with reference to specific embodiments. It isappreciated that various modifications to the referenced embodiments maybe made without departing from the scope of the disclosure as set forthin the following claims.

I claim:
 1. A medical device for generating a template, comprising: aplurality of electrodes configured to sense a cardiac signal; a storagedevice comprising a plurality of subgroups for storing beats; and aprocessor configured to: identify a plurality of beats in the sensedcardiac signal, determine that a first beat of the plurality of beats isan initial beat to be stored in the first subgroup of the plurality ofsubgroups, set the first beat as a first subgroup template beat inresponse to the first beat being the initial beat, determine, for eachremaining beat of the plurality of beats, whether to store the beatwithin a subgroup of the plurality of subgroups of the storage device,determine whether a number of beats stored in one of the plurality ofsubgroups exceeds a subgroup threshold, and in response to the number ofbeats stored in the one of the plurality of subgroups exceeding thesubgroup threshold, and generate a template beat using one or more beatsof the one of the plurality of subgroups that exceeds the subgroupthreshold.
 2. The medical device of claim 1, wherein the processor isconfigured to compare a second beat of the plurality of beats to thefirst subgroup template beat and determine a match between the secondbeat and the first subgroup template beat, determine whether the matchis greater than a match threshold, and store the second beat within thefirst subgroup in response to the match being greater than the matchthreshold.
 3. The medical device of claim 2, wherein the processor isconfigured to determine, in response to the match not being greater thanthe match threshold, whether a second subgroup has been created, createa second subgroup in response to a second subgroup having not beencreated, and set the second beat as a second subgroup template beat. 4.The medical device of claim 3, wherein the processor is configured tocompare the second beat to a second subgroup template beat of the secondsubgroup in response to a second subgroup having been created, determinea match between the second beat and the second subgroup template beat,determine whether the match between the second beat and the secondsubgroup template beat is greater than the match threshold, and storethe second beat within the second subgroup in response to the matchbetween the second beat and the second subgroup template beat beinggreater than the match threshold.
 5. The medical device of claim 2,wherein the processor is configured to compare the second beat to asecond subgroup template beat of a second subgroup and determine a matchbetween the second beat and the second subgroup template beat inresponse to the match between the second beat and the first subgrouptemplate beat not being greater than the match threshold, determinewhether the match between the second beat and the second subgrouptemplate beat is greater than the match threshold, and store the secondbeat within the second subgroup in response to the match between thesecond beat and the second subgroup template beat being greater than thematch threshold.
 6. The medical device of claim 1, wherein the pluralityof beats comprises 15 beats and the subgroup threshold comprises 10beats.
 7. The medical device of claim 6, wherein the plurality ofsubgroups comprises 4 subgroups.
 8. The medical device of claim 1,wherein the plurality of beats is a first plurality of beats, andwherein the processor is further configured to identify a next pluralityof beats in the sensed cardiac signal, in response to the number ofbeats stored in each of the plurality of subgroups not exceeding thesubgroup threshold, determine, for each of the next plurality of beats,whether to store the beat within the one of the plurality of subgroups,determine whether a number of beats of the next plurality of beatsstored in the one of the plurality of subgroups exceeds the subgroupthreshold, and generate the template beat using one or more of the beatsof the next plurality of beats stored in the one of the plurality ofsubgroups that exceeds the subgroup threshold.
 9. The medical device ofclaim 1, wherein the plurality of electrodes form a first sensing vectorsensing a first interval of the cardiac signal during a predeterminedtime period and a second sensing vector simultaneously sensing a secondinterval of the cardiac signal during the predetermined time period, andwherein the processor is configured to determine interval conditionsbased on the first interval and the second interval, and determinewhether to identify the first interval and the second interval asqualified intervals for generating a template based on the determinedintervals conditions.
 10. A subcutaneous cardiac device for generating atemplate, comprising: a plurality of electrodes configured to sense acardiac signal; a storage device; a processor configured to: identify aplurality of beats in the sensed cardiac signal, determine that a firstbeat of the plurality of beats is an initial beat to be stored in thefirst subgroup of the plurality of subgroups, set the first beat as afirst subgroup template beat in response to the first beat being theinitial beat, determine, for each remaining beat of the plurality ofbeats, whether to store the beat within a subgroup of a plurality ofsubgroups of the storage device, determine whether a number of beatsstored in one of the plurality of subgroups exceeds a subgroupthreshold, generate a template beat in response to the number of beatsstored in the one of the plurality of subgroups exceeding the subgroupthreshold using one or more beats stored in the one of the plurality ofsubgroups that exceeds the subgroup threshold, and detect a cardiacevent based at least on a comparison of beats subsequent the pluralityof beats to the generated template beat; and a high voltage outputcircuit to deliver therapy via electrodes of the plurality of electrodesin response to the processor detecting the cardiac event.
 11. Thesubcutaneous cardiac device of claim 10, wherein the processor isconfigured to compare a second beat of the plurality of beats to thefirst subgroup template beat and determine a match between the secondbeat and the first subgroup template beat, determine whether the matchis greater than a match threshold, and store the second beat within thefirst subgroup in response to the match being greater than the matchthreshold.
 12. The subcutaneous cardiac device of claim 11, wherein theprocessor is configured to determine, in response to the match not beinggreater than the match threshold, whether a second subgroup has beencreated, and set the second beat as a second subgroup template beat inresponse to a second beat subgroup not being created.
 13. Thesubcutaneous cardiac device of claim 12, wherein the processor isconfigured to compare the second beat to a second subgroup template beatof the second subgroup in response to a second subgroup being created,determine a match between the second beat and the second subgrouptemplate beat, determine whether the match between the second beat andthe second subgroup template beat is greater than the match threshold,and store the second beat within the second subgroup in response to thematch between the second beat and the second subgroup template beatbeing greater than the match threshold.
 14. The subcutaneous cardiacdevice of claim 11, wherein the processor is configured to compare thesecond beat to a second subgroup template beat of a second subgroup anddetermine a match between the second beat and the second subgrouptemplate beat in response to the match between the second beat and thefirst subgroup template beat not being greater than the match threshold,determine whether the match between the second beat and the secondsubgroup template beat is greater than the match threshold, and storethe second beat within the second subgroup in response to the matchbetween the second beat and the second subgroup template beat beinggreater than the match threshold.
 15. The subcutaneous cardiac device ofclaim 10, wherein the plurality of beats is a first plurality of beats,and wherein the processor is further configured to identify a nextplurality of beats in the sensed cardiac signal in response to thenumber of beats stored in the one of the plurality of subgroups notexceeding the subgroup threshold, determine, for each of the nextplurality of beats, whether to store the beat within the one of theplurality of subgroups, determine whether a number of beats of the nextplurality of beats stored in the one of the plurality of subgroupsexceeds the subgroup threshold, and generate the template beat using oneor more of the beats of the next plurality of beats stored the in one ofthe plurality of subgroups that exceeds the subgroup threshold.
 16. Themedical device of claim 1, wherein the processor is configured togenerate the template beat by averaging the beats stored within the oneof the plurality of subgroups that exceeds the subgroup threshold. 17.The medical device of claim 1, wherein the processor is furtherconfigured to: detect a cardiac event based at least on a comparison ofbeats subsequent the plurality of beats to the generated template beat;and control the medical device to deliver a therapy in response to thedetection of the cardiac event.
 18. The medical device of claim 17,further comprising a high voltage output circuit to deliver the therapy,wherein the therapy comprises an anti-tachyarrhythmia shock.
 19. Themedical device of claim 1, wherein the plurality of beats is a firstplurality of beats, and wherein the processor is configured to, for eachof the plurality of subgroups, compare a beat of the first plurality ofbeats to a respective subgroup template beat and determine a matchbetween the beat and the subgroup template beat, determine whether thematch is greater than a match threshold, and, in response to determiningthat the match is not greater than a match threshold for each of theplurality of subgroup template beats, discard the first plurality ofbeats and identify a second plurality of beats in the sensed cardiacsignal, wherein the processor is configured to determine, for each ofthe next plurality of beats, whether to store the beat within the one ofthe plurality of subgroups, determine whether a number of beats of thenext plurality of beats stored in the one of the plurality of subgroupsexceeds the subgroup threshold, and generate the template beat using oneor more of the beats of the next plurality of beats stored in the one ofthe plurality of subgroups that exceeds the subgroup threshold.
 20. Thesubcutaneous cardiac device of claim 10, wherein the plurality of beatsis a first plurality of beats, and wherein the processor is configuredto, for each of the plurality of subgroups, compare a beat of the firstplurality of beats to a respective subgroup template beat and determinea match between the beat and the subgroup template beat, determinewhether the match is greater than a match threshold, and, in response todetermining that the match is not greater than a match threshold foreach of the plurality of subgroup template beats, discard the firstplurality of beats and identify a second plurality of beats in thesensed cardiac signal, wherein the processor is configured to determine,for each of the next plurality of beats, whether to store the beatwithin the one of the plurality of subgroups, determine whether a numberof beats of the next plurality of beats stored in the one of theplurality of subgroups exceeds the subgroup threshold, and generate thetemplate beat using one or more of the beats of the next plurality ofbeats stored in the one of the plurality of subgroups that exceeds thesubgroup threshold.